|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atomikos.util.IOHelper
public class IOHelper
A helper class for common IO tasks.
Constructor Summary | |
---|---|
IOHelper()
|
Method Summary | |
---|---|
static void |
copyBytes(InputStream in,
OutputStream out)
Copy every byte from the source to the output. |
static boolean |
createPathTo(File file,
boolean isDirectory)
Recursively create the path to the given file if it does not exist. |
static boolean |
deleteContents(File folder)
Recursively delete the contents of the given folder. |
static String |
getDifferencePath(File fromFolder,
File toFile)
Get the difference path of a file wrt a folder. |
static String |
getRelativePath(File fromFolder,
File toFile)
Gets the relative path of a file wrt one of its parent directories. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOHelper()
Method Detail |
---|
public static void copyBytes(InputStream in, OutputStream out) throws IOException
in
- The source stream.out
- The output stream.
IOException
- On IO errors.public static String getRelativePath(File fromFolder, File toFile) throws IOException
fromFolder
- The parent directorytoFile
- The file
IOException
- On error, for instance if toFile is not in fromFolderpublic static String getDifferencePath(File fromFolder, File toFile) throws IOException
fromFolder
- The folder.toFile
- The file. This file should be contained in the parent
of fromFolder!
IOException
public static boolean createPathTo(File file, boolean isDirectory) throws IOException
file
- The file to create. All nonexistent parent folders will also
be created.isDirectory
- True iff the file should be a directory
IOException
public static boolean deleteContents(File folder) throws IOException
folder
- The folder to delete.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |