public class DeleteFilesTask extends SwingWorker<Boolean,Void>
SwingWorker.StateValue| Modifier and Type | Field and Description |
|---|---|
private static org.apache.log4j.Logger |
logger |
private String |
userDirName |
| Constructor and Description |
|---|
DeleteFilesTask()
This is the empty standard constructor.
|
DeleteFilesTask(String userDirName)
This is the constructor, one can implicitly define the directory to be
deleted.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteDirectory(File dir)
This method deletes a directory all files and sub-directories by
recursion.
|
void |
deleteTemporaryUserData(File userTempDir)
This method deletes all directories and files a specified directory.
|
protected Boolean |
doInBackground() |
String |
getUserDirName() |
void |
setUserDirName(String userDirName) |
addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgressprivate static final org.apache.log4j.Logger logger
private String userDirName
public DeleteFilesTask()
deleteTemporaryUserData(File) method.public DeleteFilesTask(String userDirName)
userDirName - protected Boolean doInBackground() throws InterruptedException
doInBackground in class SwingWorker<Boolean,Void>InterruptedExceptionpublic void deleteTemporaryUserData(File userTempDir)
ConfigManager.validateAndSetConfiguration() at
application startup for cleaning the temporary directory.userTempDir - - the name of the directorypublic boolean deleteDirectory(File dir)
true if all deletions are successful. If
a deletion fails, the method stops to delete and returns
false. This method is used by
deleteTemporaryUserData(File).dir - - the directory to be (recursively) deletedpublic String getUserDirName()
public void setUserDirName(String userDirName)
userDirName - the userDirName to setCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.