public final class FileIO extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
changeExtension(File file,
String newExtension)
Change the extension of a file, based off of the period extension notation.
|
void |
concatenateStreams(Reader[] readers,
File outputFile)
Take a bunch of readers (files or otherwise) and concatenate
their input together into one output file.
|
static void |
copyStream(InputStream from,
OutputStream to)
Will copy content from an inputstream to an output stream, closing the files when it has completed.
|
static String |
getFileExtension(File file)
Parses the extension of a file.
|
static String |
removeFileExtension(File file)
Remove the extension from a file.
|
public static void copyStream(InputStream from, OutputStream to) throws IOException
from - The expected file to read in fromto - The expected file to write toIOException - if there was any issues copying the resourcepublic void concatenateStreams(Reader[] readers, File outputFile) throws IOException
readers - the readers to concatenate togetheroutputFile - the output file to write toIOException - if any problems occur during reading, writing, or concatenationpublic static String getFileExtension(File file)
file - the file to parsepublic static String removeFileExtension(File file)
file - the file to parsepublic static void changeExtension(File file, String newExtension) throws IOException
file - the file that you would like to change the extension ofnewExtension - The extension that you would like to change it toIOException - If the system is unable to rename the fileCopyright © 2015. All Rights Reserved.