|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dmonix.io.IOUtil
I/O related utility methods.
Copyright: Copyright (c) 2003
Company: dmonix.org
| Method Summary | |
static void |
copyFile(java.io.File source,
java.io.File target)
Copy a file from an other file. |
static void |
copyFile(java.io.InputStream source,
java.io.File target)
Copy a file from a source. |
static void |
copyFile(java.net.URL url,
java.io.File target)
Copy a file from a URL. |
static void |
copyFileNoException(java.io.File source,
java.io.File target)
Copy a file from a source. |
static void |
copyFileNoException(java.io.InputStream source,
java.io.File target)
Copy a file from a source. |
static void |
copyFileNoException(java.net.URL url,
java.io.File target)
Copy a file from a URL. |
static void |
copyStreams(java.io.InputStream source,
java.io.OutputStream target)
Copy data between two streams. |
static void |
copyStreams(java.io.InputStream source,
java.io.OutputStream target,
boolean closeSource,
boolean closeTarget)
Copy data between two streams. |
static int |
deleteDirectory(java.io.File dir)
The method deletes a directory. |
static boolean |
deleteFile(java.io.File file)
Remove a single file. |
static boolean |
deleteFile(java.lang.String file)
Remove a single file. |
static void |
deleteFiles(java.io.File[] files)
Remove an array of files. |
static int |
deleteFiles(java.io.File dir,
java.io.FileFilter filter)
Recursively deletes all files in the provided path that match the filter. |
static int |
deleteFiles(java.io.File dir,
java.io.FilenameFilter filter)
Recursively deletes all files in the provided path that match the filter. |
static java.lang.String |
getRelativePath(java.io.File directory,
java.io.File file)
Return the relative path between the directory and the file. |
static java.io.File[] |
listFiles(java.io.File dir)
Recursively lists all files for a directory. |
static java.io.File[] |
listFiles(java.io.File dir,
java.io.FileFilter filter)
Recursively lists all files for a directory. |
static java.io.File[] |
listFiles(java.io.File dir,
java.io.FilenameFilter filter)
Recursively lists all files for a directory. |
static void |
makeBackup(java.io.File file)
Create a backup file of the specified file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void copyFile(java.io.InputStream source,
java.io.File target)
throws java.io.IOException
target - The target filesource - The source
java.io.IOException
public static void copyFile(java.io.File source,
java.io.File target)
throws java.io.IOException
source - The source filetarget - The target file
java.io.IOException
public static void copyFile(java.net.URL url,
java.io.File target)
throws java.io.IOException
url - The source URLtarget - The target file
java.io.IOException
public static void copyFileNoException(java.io.File source,
java.io.File target)
target - The target filesource - The source
public static void copyFileNoException(java.io.InputStream source,
java.io.File target)
target - The target filesource - The source
public static void copyFileNoException(java.net.URL url,
java.io.File target)
target - The target fileurl - The source URL
public static void copyStreams(java.io.InputStream source,
java.io.OutputStream target)
throws java.io.IOException
copyStreams(InputStream, OutputStream, true, true)
source - The source streamtarget - The target stream
java.io.IOException
public static void copyStreams(java.io.InputStream source,
java.io.OutputStream target,
boolean closeSource,
boolean closeTarget)
throws java.io.IOException
source - The source streamtarget - The target streamcloseSource - If the source stream is to be closedcloseTarget - If the target stream is to be closed
java.io.IOExceptionpublic static int deleteDirectory(java.io.File dir)
File.delete() only works on empty directories
this method will recursively find and delete all sub-directories and files
to the input directory.
dir - The directory to be deleted
public static boolean deleteFile(java.io.File file)
deleteDirectory(File)
Level.FINE
file - The file to remove
deleteDirectory(File)public static boolean deleteFile(java.lang.String file)
deleteDirectory(File)
Level.FINE
file - The file to remove
deleteDirectory(File)
public static int deleteFiles(java.io.File dir,
java.io.FileFilter filter)
deleteFile(File)
dir - The directory pathfilter - The filter
public static int deleteFiles(java.io.File dir,
java.io.FilenameFilter filter)
deleteFile(File)
dir - The directory pathfilter - The filter
public static void deleteFiles(java.io.File[] files)
files - The files to remove
public static java.lang.String getRelativePath(java.io.File directory,
java.io.File file)
directory - The directoryfile - The file
public static java.io.File[] listFiles(java.io.File dir)
File array.listFiles(File, AcceptAllFileFilter)
dir - The directory to list items for
AcceptAllFilter
public static java.io.File[] listFiles(java.io.File dir,
java.io.FileFilter filter)
File array.
dir - The directory to list items forfilter - The filter
public static java.io.File[] listFiles(java.io.File dir,
java.io.FilenameFilter filter)
File array.
dir - The directory to list items forfilter - The filter
public static void makeBackup(java.io.File file)
.bak.
file - the file to backup
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||