|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.CopyFile
public class CopyFile
This class provides a simple way to copy a file that exists.
Field Summary | |
---|---|
static java.lang.String |
FILE_SEPERATOR
The character used to seperate files and folders. |
Constructor Summary | |
---|---|
CopyFile()
Constructs a new CopyFile object without a file to copy. |
|
CopyFile(java.io.File file)
Constructs a new CopyFile object with a known file to copy. |
Method Summary | |
---|---|
java.io.File |
copyFile(boolean showProgress)
Creates a new copy of the original file without overwriting the file. |
void |
createZIPFileBackup(java.util.ArrayList<java.io.File> filesToZip)
Creates a zip to the Data folder containing the given files with a name including the current time in milliseconds. |
java.io.File |
getOriginalFile()
Returns the original file to copy |
static void |
main(java.lang.String[] args)
|
void |
setOriginalFile(java.io.File originalFile)
Sets the file to copied in the CopyFile object |
java.io.File |
write(java.io.File outputFile,
boolean showProgress)
Copies the original file to a new file, if the file exists in the directory it will be given a name to prevent overwriting it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_SEPERATOR
Constructor Detail |
---|
public CopyFile(java.io.File file)
file
- The file that is to be copied elsewhere.public CopyFile()
Method Detail |
---|
public java.io.File getOriginalFile()
public void setOriginalFile(java.io.File originalFile)
originalFile
- the file to copypublic java.io.File copyFile(boolean showProgress)
showProgress
- If true, a ProgressMonitorDialog box will appear showing the
copy progress.
public java.io.File write(java.io.File outputFile, boolean showProgress)
outputFile
- the file to output to. If the file exists in that directory
it will be given a name that is unique.showProgress
- If true, a ProgressMonitorDialog box will appear showing the
copy progress.
public void createZIPFileBackup(java.util.ArrayList<java.io.File> filesToZip)
filesToZip
- The array list of files to include in a backup zip file
in the user directory.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |