Files Tutorials
Working with files in Java can be surprisingly easy when you have examples to work with.
This page attempts to provide those examples.
-
How do I write a String to a File?
-
How do I read a String from a File?
-
How do I write a JavaBean to an XML file using JOX?
-
How do I read a JavaBean from an XML file using JOX?
-
How do I write a JavaBean to an XML file using XMLEncoder?
-
How do I read a JavaBean from an XML file using XMLDecoder?
-
How do I write to an Excel file using POI?
-
How do I read from an Excel file using POI?
-
How do I write to a PDF file using iText?
-
How do I read a properties file?
-
How do I write a properties file?
-
How do I read properties from an XML file?
-
How do I write properties to an XML file?
-
How do I read a String from a File line-by-line?
-
How do I read a properties file with a Resource Bundle?
-
How do I display the contents of a zip file?
-
How do I unzip the contents of a zip file?
-
How can I create a zip file from a set of files?
-
How can I create an uncompressed zip file from a set of files?
-
What's the difference between a file's path, absolute path, and canonical path?
-
How do I get a URL or URI to a file?
-
How do I display the contents of a directory?
-
How do I use a FileFilter to display only the directories within a directory?
-
How do I use a FilenameFilter to display a subset of files in a directory?
-
How do I recursively display all files and directories in a directory?
-
How do I zip a directory and all its contents?
-
How do I deflate and inflate a file?
-
How do I compress and uncompress a gzip file?
-
How do I write the contents of a file to standard output?
-
How do I write an object to a file and read it back?
-
How do I redirect standard output to a file?
-
How do I redirect standard error to a file?
-
How do I generate an MD5 digest for a file?
-
How do I encrypt and decrypt files using DES?
-
How do I use a SequenceInputStream to connect several FileInputStreams?
-
How do I alphabetically sort the lines of a file?
-
How do I write a String to a File using Commons IO?
-
How do I read a String from a File using Commons IO?
-
How do I get a List of the lines in a File using Commons IO?
-
How do I get a List of the lines in a File using Commons IO and alphabetize them?
-
How do I determine the size of a directory?
-
How do I display a cleanly formatted file size?
-
How do I perform a touch on a file?
-
How do I get all files in a directory including subdirectories using Commons IO?
-
How do I get all files with certain extensions in a directory including subdirectories?
-
How do I determine the free space on a drive?
-
What's a quick way to tell if the contents of two files are identical or not?
-
How do I copy a file?
-
How do I copy a file to a directory?
-
How do I move a file?
-
How do I move a file to a directory?
-
How do I filter files based on their last-modified dates?
-
How do I get the directories in a directory using a filter?
-
How do I select files to a particular depth in a directory?
-
How do I get the files in a directory using a filter?
-
How do I get the hidden or visible files in a directory using a filter?
-
How do I sort an array of files according to their last modified dates?
-
How do I sort an array of files according to their names?
-
How do I get an array of files based on a file prefix?
-
How do I get an array of files based on a regular expression?
-
How do I sort an array of files according to their sizes?
-
How do I get an array of files based on a file suffix?
|