|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.util.FileUtil
public class FileUtil
Method Summary | |
---|---|
static void |
copyFile(File srcFile,
File destFile)
Copies the file srcFile into the destination file destFile. |
static boolean |
delete(File f)
Deletes the file or empty directory f, and returns the success indicator of the operation. |
static void |
moveFile(File srcFile,
File destFile)
Moves the file srcFile to destFile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean delete(File f)
File.delete()
,
except that if the first call to delete fails,
it attemps to call the method a second time after
10ms.
This is a heuristic attempt to fix a possible race
condition when deleting a file under Windows XP inspired
from Ant's source code.
f
- the file or empty being deleted.
public static void copyFile(File srcFile, File destFile) throws IOException
srcFile
- the source file.destFile
- the destination file.
IOException
- if a problem occurs during
the copy.
NullPointerException
- if any argument is null.public static void moveFile(File srcFile, File destFile) throws IOException
File)
,
except it deletes the source file after the copy
succeeds.
Moreover, before making a full copy of the file,
the method tries to use File.renameTo(File)
which might rename the file without copying it
on some platforms.
The copy happens only if the call to File.renameTo(File)
fails.
srcFile
- the source file.destFile
- the destination file.
IOException
- if a problem occurs during file moving.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |