|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.ide.util.FileCopyUtil
Since there is no internal java class/method to copy a file, this class contains simple static utility methods to copy files. In addition to copying a file or files, it will create the required directory trees for the output files.
The two main methods you will use are
copyFile - Copies one file
copyDir - Copies a directory
The copyDir method has a parameter for recursing directories while copying, there is logic in place to circumvent infinite loops created by symlinks, hardlinks, or other shortcuts.
| Method Summary | |
static void |
copyDir(java.io.File src,
java.io.File target,
boolean recurse,
boolean overwrite)
Copies all files from src to target. |
static void |
copyDir(java.lang.String src,
java.lang.String target,
boolean recurse,
boolean overwrite)
Copies all files from src to target. |
static void |
copyFile(java.io.File src,
java.io.File target,
boolean overwrite)
Copies one file (src) to target. |
static void |
copyFile(java.lang.String src,
java.lang.String target,
boolean overwrite)
Copies one file (src) to target. |
static void |
main(java.lang.String[] args)
Test |
| 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.File src,
java.io.File target,
boolean overwrite)
throws java.io.IOException
File
objects.
src - Source filetarget - Desired destination fileoverwrite - If the file exists, should it be overwritten
java.io.IOExceptioncopyFile(String, String)
public static void copyFile(java.lang.String src,
java.lang.String target,
boolean overwrite)
throws java.io.IOException
String
objects.
overwrite - if the file exists, should it be overwrittensrc - Source filetarget - Desired targetination file
java.io.IOException@copyFile(File, File)
public static void copyDir(java.io.File src,
java.io.File target,
boolean recurse,
boolean overwrite)
throws java.io.IOException
File
objects.
src - Source directorytarget - targetination directoryrecurse - Recurse through sub directories or foldersoverwrite - If the file exists, should it be overwritten
java.io.IOExceptioncopyDir(String, String)
public static void copyDir(java.lang.String src,
java.lang.String target,
boolean recurse,
boolean overwrite)
throws java.io.IOException
String
objects.
recurse - Recurse through sub directories or foldersoverwrite - If the file exists, should it be overwritten
java.io.IOException.
java.io.IOException#copyDir(File, File)public static void main(java.lang.String[] args)
|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©1997, 2003, Oracle. All rights reserved.