|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.io.Backup
@Todo(value="replace File with Path once switched to JDK 7") public class Backup
allows to easily backup directories. Copied are only those files that do not exist or have a modification date after the one that exists or have a different file length. Other existing files in the target directory remain there.
MyFile.synchronizeDir(File),
BackupFrame| Constructor Summary | |
|---|---|
Backup(File originDir,
File destinationDir)
|
|
Backup(File originDir,
File destinationDir,
FileFilter filter)
|
|
Backup(File originDir,
File destinationDir,
FileFilter filter,
boolean deleteAtTarget)
|
|
Backup(File originDir,
File destinationDir,
FileFilter filter,
boolean deleteAtTarget,
Monitor monitor,
Logger logger)
|
|
| Method Summary | |
|---|---|
void |
cancel()
sets the embedded monitor to be disabled |
TimerTask |
createTimerTask()
|
boolean |
getDeleteAtTarget()
|
File |
getDestinationDir()
|
FileFilter |
getFilter()
|
Logger |
getLogger()
acess to the (non-null) Logger suitable for logging entries in the context of this instance |
Monitor |
getMonitor()
|
File |
getOriginDir()
|
boolean |
isAlwaysCopy()
|
boolean |
isRunning()
|
static void |
main(String[] args)
|
void |
run()
performs the backup operation |
void |
setAlwaysCopy(boolean alwaysCopy)
|
void |
setDeleteAtTarget(boolean flag)
|
void |
setDestinationDir(File destinationDir)
|
void |
setExcludeFiles(File[] excludeList)
replaces any previous filter; the path matching is case-insensitive |
void |
setFilter(FileFilter filter)
|
void |
setLogger(Logger logger)
the logger may not be set while the backup is running |
void |
setMonitor(Monitor monitor)
|
void |
setNoSubDirsFilter()
replaces any previous filter |
void |
setOriginDir(File originDir)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Backup(File originDir,
File destinationDir)
public Backup(File originDir,
File destinationDir,
FileFilter filter)
public Backup(File originDir,
File destinationDir,
FileFilter filter,
boolean deleteAtTarget)
public Backup(File originDir,
File destinationDir,
FileFilter filter,
boolean deleteAtTarget,
Monitor monitor,
Logger logger)
| Method Detail |
|---|
public void setNoSubDirsFilter()
throws IllegalStateException
IllegalStateException
public void setExcludeFiles(File[] excludeList)
throws IllegalArgumentException
IllegalArgumentExceptionpublic boolean isRunning()
public TimerTask createTimerTask()
public void run()
run in interface Runnablepublic void cancel()
public boolean getDeleteAtTarget()
public void setDeleteAtTarget(boolean flag)
public boolean isAlwaysCopy()
public void setAlwaysCopy(boolean alwaysCopy)
public Monitor getMonitor()
public Logger getLogger()
LoggerProvider
getLogger in interface LoggerProviderpublic FileFilter getFilter()
public void setLogger(Logger logger)
throws IllegalStateException
IllegalStateException
public void setMonitor(Monitor monitor)
throws IllegalStateException
IllegalStateException
public void setFilter(FileFilter filter)
throws IllegalStateException
IllegalStateException
public void setOriginDir(File originDir)
throws IllegalStateException
IllegalStateException
public void setDestinationDir(File destinationDir)
throws IllegalStateException
IllegalStateExceptionpublic File getOriginDir()
public File getDestinationDir()
public static void main(String[] args)
throws IOException
IOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||