net.datacrow.drivemanager
Class DriveManager
java.lang.Object
net.datacrow.drivemanager.DriveManager
public class DriveManager
- extends java.lang.Object
The Drive Manager of Data Crow. Schedules tasks to scan drives for files,
allows current file locations to be retrieved and checks the system for new
mounted / inserted discs.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_PRECISION_LOWEST
public static final int _PRECISION_LOWEST
- See Also:
- Constant Field Values
_PRECISION_MEDIUM
public static final int _PRECISION_MEDIUM
- See Also:
- Constant Field Values
_PRECISION_HIGHEST
public static final int _PRECISION_HIGHEST
- See Also:
- Constant Field Values
getInstance
public static DriveManager getInstance()
startDrivePoller
public void startDrivePoller()
throws JobAlreadyRunningException
- Throws:
JobAlreadyRunningException
startFileSynchronizer
public void startFileSynchronizer(int precision)
throws JobAlreadyRunningException
- Throws:
JobAlreadyRunningException
sendMessage
public void sendMessage(java.util.Collection<IDriveManagerListener> listeners,
java.lang.String msg)
notifyJobStopped
public void notifyJobStopped(java.util.Collection<IDriveManagerListener> listeners)
notifyJobStarted
public void notifyJobStarted(java.util.Collection<IDriveManagerListener> listeners)
restartScan
public void restartScan(java.io.File drive)
startScanners
public void startScanners()
throws JobAlreadyRunningException
- Throws:
JobAlreadyRunningException
drivesWereScanned
public boolean drivesWereScanned()
stopScanners
public void stopScanners()
stopDrivePoller
public void stopDrivePoller()
stopFileSynchronizer
public void stopFileSynchronizer()
setDrives
public void setDrives(java.util.Collection<java.io.File> drives)
throws JobAlreadyRunningException
- Throws:
JobAlreadyRunningException
getExcludedDirs
public java.util.Collection<java.lang.String> getExcludedDirs()
getTempFileSuffix
protected java.lang.String getTempFileSuffix()
getTempDir
protected java.lang.String getTempDir()
getPollerListeners
public java.util.Collection<IDriveManagerListener> getPollerListeners()
getScannerListeners
public java.util.Collection<IDriveManagerListener> getScannerListeners()
getSynchronizerListeners
public java.util.Collection<IDriveManagerListener> getSynchronizerListeners()
getDrives
public java.util.Collection<java.io.File> getDrives()
isScanActive
public boolean isScanActive()
notifyScanComplete
protected void notifyScanComplete(DriveScanner scanner)
setExcludedDirectories
public void setExcludedDirectories(java.util.Collection<java.lang.String> directories)
throws JobAlreadyRunningException
- Throws:
JobAlreadyRunningException
isDirExcluded
protected boolean isDirExcluded(java.io.File directory)
exclude
public void exclude(java.lang.String directory)
addPollerListener
public void addPollerListener(IDriveManagerListener listener)
addScannerListener
public void addScannerListener(IDriveManagerListener listener)
addSynchronizerListener
public void addSynchronizerListener(IDriveManagerListener listener)
find
public FileInfo find(FileInfo fi,
int precision)
- Retrieves the actual location / file for the given filename.
The size and the hash of the original file are used to determine its new
location.