java.lang.Object
java.lang.Thread
MochaBackupClasses.MochaBackupThread
- All Implemented Interfaces:
- java.lang.Runnable
- public final class MochaBackupThread
- extends java.lang.Thread
MochaBackupThread is the the thread that handles most of the work
for the backup process. Once started, it will go through the requested
process until requested to cancel.
Note: I know it's not good practice to access a window's GUI components
from another thread. In windows programming, this is a big no no with
MFC. I haven't seen any evidence that indicates this in Java yet so
I'll just leave it as it is for now until I find evidence and decide to
change it.
|
Nested Class Summary |
static class |
MochaBackupThread.MochaThreadData
Class for a thread data object to pass various Swing control
references and other options to the backup thread. |
| Nested classes inherited from class java.lang.Thread |
java.lang.Thread.UncaughtExceptionHandler |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
mochaThreadData
private MochaBackupThread.MochaThreadData mochaThreadData
totalFileCount
private int totalFileCount
totalFilesComplete
private int totalFilesComplete
percentMod
private double percentMod
MochaBackupThread
public MochaBackupThread(MochaBackupThread.MochaThreadData threadData)
addFileToZip
private void addFileToZip(java.util.zip.ZipOutputStream outputZip,
java.io.File file,
boolean useAbsolute)
throws java.io.IOException
- Add a file to the zip archive specified by outputZip.
This method also updates the progress bar, and the text area.
addDirToZip
private void addDirToZip(java.util.zip.ZipOutputStream outputZip,
java.io.File path,
boolean useAbsolute)
throws java.io.IOException
- Add a file or path to the zip archive specified by outputZip.
This method also updates the progress bar, and the text area.
analyzeFiles
private int analyzeFiles(java.io.File path)
backup
private void backup()
run
public void run()
- Description copied from class:
java.lang.Thread
- The method of Thread that will be run if there is no Runnable object
associated with the Thread. Thread's implementation does nothing at all.