net.sf.jfilesync.sync2
Class SyncTreeBuilder3

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.gnocchi.GWorker
          extended by net.sf.jfilesync.sync2.SyncTreeBuilder3
All Implemented Interfaces:
java.lang.Runnable, net.sf.gnocchi.GWorkerListener

public class SyncTreeBuilder3
extends net.sf.gnocchi.GWorker
implements net.sf.gnocchi.GWorkerListener


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  AbstractConnectionProxy con
           
private  java.util.Queue<SyncFile> dirsToGo
           
private  ExpressionList excludeList
           
private  ExpressionList includeList
           
private static java.util.logging.Logger LOGGER
           
private static int MAX_WORKERS
           
private  int numFiles
           
private  net.sf.gnocchi.GWorkerObserver observer
           
private  boolean opt_fat_mode
           
private  boolean opt_follow_symlinks
           
private  java.lang.String path
           
private  SyncTree tree
           
private  java.util.Map<net.sf.gnocchi.GWorker,SyncFile> worker2dir
           
 
Fields inherited from class net.sf.gnocchi.GWorker
STATE_DIED, STATE_DONE, STATE_INTERRUPTED, STATE_READY, STATE_RUNNING
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SyncTreeBuilder3(AbstractConnectionProxy con, java.lang.String path)
           
 
Method Summary
 net.sf.gnocchi.GWorkerEvent construct()
           
private  void excludeChilds(SyncFile dir)
           
private  long fatModTime(long time)
           
private  boolean inExcludeList(SyncFile file)
           
private  boolean inIncludeList(SyncFile file)
           
private  void init()
           
private  void loadSettings()
           
 void setExcludeExpressionList(ExpressionList list)
           
 void setFatModeEnabled(boolean enabled)
           
 void setIncludeExpressionList(ExpressionList list)
           
private  boolean setViewState(SyncFile file)
           
private  void setViewStateOfTree()
           
 void task()
           
 void updateModel(net.sf.gnocchi.GWorkerEvent e)
           
 void workerCancelled(net.sf.gnocchi.GWorkerEvent e)
           
 void workerDied(net.sf.gnocchi.GWorkerEvent e)
           
 void workerDone(net.sf.gnocchi.GWorkerEvent e)
           
 
Methods inherited from class net.sf.gnocchi.GWorker
addObserver, cancel, customCancel, getException, getObserver, getWorkerState, hasDied, isCancelled, isDone, isFinished, isRunning, run, setDied
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

private static final java.util.logging.Logger LOGGER

observer

private final net.sf.gnocchi.GWorkerObserver observer

tree

private SyncTree tree

con

private final AbstractConnectionProxy con

path

private final java.lang.String path

numFiles

private volatile int numFiles

opt_follow_symlinks

private boolean opt_follow_symlinks

opt_fat_mode

private boolean opt_fat_mode

includeList

private ExpressionList includeList

excludeList

private ExpressionList excludeList

dirsToGo

private final java.util.Queue<SyncFile> dirsToGo

worker2dir

private final java.util.Map<net.sf.gnocchi.GWorker,SyncFile> worker2dir

MAX_WORKERS

private static final int MAX_WORKERS
See Also:
Constant Field Values
Constructor Detail

SyncTreeBuilder3

public SyncTreeBuilder3(AbstractConnectionProxy con,
                        java.lang.String path)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

loadSettings

private void loadSettings()

setIncludeExpressionList

public void setIncludeExpressionList(ExpressionList list)

setExcludeExpressionList

public void setExcludeExpressionList(ExpressionList list)

setFatModeEnabled

public void setFatModeEnabled(boolean enabled)

init

private void init()
           throws java.io.IOException
Throws:
java.io.IOException

task

public void task()
          throws java.lang.Exception
Specified by:
task in class net.sf.gnocchi.GWorker
Throws:
java.lang.Exception

construct

public net.sf.gnocchi.GWorkerEvent construct()
Specified by:
construct in class net.sf.gnocchi.GWorker

setViewStateOfTree

private void setViewStateOfTree()

setViewState

private boolean setViewState(SyncFile file)

excludeChilds

private void excludeChilds(SyncFile dir)

inIncludeList

private boolean inIncludeList(SyncFile file)

inExcludeList

private boolean inExcludeList(SyncFile file)

fatModTime

private long fatModTime(long time)

updateModel

public void updateModel(net.sf.gnocchi.GWorkerEvent e)
Specified by:
updateModel in interface net.sf.gnocchi.GWorkerListener

workerCancelled

public void workerCancelled(net.sf.gnocchi.GWorkerEvent e)
Specified by:
workerCancelled in interface net.sf.gnocchi.GWorkerListener

workerDied

public void workerDied(net.sf.gnocchi.GWorkerEvent e)
Specified by:
workerDied in interface net.sf.gnocchi.GWorkerListener

workerDone

public void workerDone(net.sf.gnocchi.GWorkerEvent e)
Specified by:
workerDone in interface net.sf.gnocchi.GWorkerListener