|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.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 filecopyDir
- 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 overwrittenjava.io.IOException
copyFile(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 filejava.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 overwrittenjava.io.IOException
copyDir(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 overwrittenjava.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, 2004, Oracle. All rights reserved.