|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.SwingWorker<java.lang.Void,java.lang.Void>
task.CleanMusicDir
public class CleanMusicDir
This class provides functionality for backing up, deleting, and starting an orphaned file removal task. Once duplicate files have been found the user selects files to be operated on, and then this class will process them.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.SwingWorker |
---|
javax.swing.SwingWorker.StateValue |
Constructor Summary | |
---|---|
CleanMusicDir(java.util.ArrayList<java.io.File> selectedFiles,
java.util.ArrayList<java.io.File> allDupFiles,
java.io.File backupDir,
SongTable table,
boolean backup,
boolean del)
Creates a new CleanDirectory SwingWorker background task. |
Method Summary | |
---|---|
void |
backupFiles(java.util.ArrayList<java.io.File> filesToBackup,
java.io.File backupDir)
Copies the selected files to a destination directory using the CopyFile class. |
boolean[] |
deleteFiles(java.util.ArrayList<java.io.File> filesToDelete)
Deletes the user selected files. |
java.lang.Void |
doInBackground()
Runs the main task of backing up and or deleting selected files. |
void |
done()
The method called after the doInBackground method is finished by the SwingWorker task. |
Methods inherited from class javax.swing.SwingWorker |
---|
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CleanMusicDir(java.util.ArrayList<java.io.File> selectedFiles, java.util.ArrayList<java.io.File> allDupFiles, java.io.File backupDir, SongTable table, boolean backup, boolean del)
selectedFiles
- the files the user has selected to be operated on.allDupFiles
- all of the found duplicate files. This is necessary
to help remove the lock that placed on a file during processing. If the file
is being deleted it must be removed from both the filesToProcess/selectedFiles
as well as AllDuplicateFiles/allDupFiles array lists.backupDir
- The directory to backup filesToProcess to.table
- the table displaying a list of all found duplicate filesbackup
- Whether or not the user has decided to backup the list of
duplicated files to process.del
- Whether or not the user has decided to delete the files to processMethod Detail |
---|
public java.lang.Void doInBackground()
doInBackground
in class javax.swing.SwingWorker<java.lang.Void,java.lang.Void>
public void done()
done
in class javax.swing.SwingWorker<java.lang.Void,java.lang.Void>
public void backupFiles(java.util.ArrayList<java.io.File> filesToBackup, java.io.File backupDir)
filesToBackup
- The files to copy to the given backup directory.backupDir
- The directory to send the files to copy to.public boolean[] deleteFiles(java.util.ArrayList<java.io.File> filesToDelete)
filesToDelete
- The files to delete.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |