com.jalios.jcms.fileprocessor
Class DirectoryScanner

java.lang.Object
  extended by com.jalios.jcms.fileprocessor.DirectoryScanner

public class DirectoryScanner
extends Object

This class perform a scan of the repository base directory.

It lists all the files to process.

This scanner will not process more files in once scan than the number specified in the repository configuration through property "maxFilesPerScan", which default value is 50000.
The remaining files will be processed during the next invocation to the scanner.

Version:
$Revision: 27882 $

Field Summary
static String REVISION
           
 
Constructor Summary
DirectoryScanner(Repository repository)
          Build a new DirectoryScanner for the specified repository.
 
Method Summary
 Set<File> getFilesToProcess()
          Retrieve the set of all the files that have to be processed.
 long getLastScanDuration()
          Retrieve the last scan duration
 Date getLastScanEndDate()
          Retrieve the last scan date
 long getLastScanFileCount()
          Retrieve the number of files found in the last scan
 boolean isPartialScan()
          Check if the last scan was interrupted because the maximum number of file per scan was reached.
 boolean isRunning()
          Check if this directory scanner is currently running.
 void scan()
          Scan recursively the repository's directory and maintains in memory all files that have to be process, it associates FILE_CREATE_OR_UPDATE operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

DirectoryScanner

public DirectoryScanner(Repository repository)
Build a new DirectoryScanner for the specified repository.

Parameters:
repository - the repository for which this DirectoryScanner will work
Method Detail

scan

public void scan()
Scan recursively the repository's directory and maintains in memory all files that have to be process, it associates FILE_CREATE_OR_UPDATE operation.


isRunning

public boolean isRunning()
Check if this directory scanner is currently running.

Returns:
true if it is running, false otherwise

getFilesToProcess

public Set<File> getFilesToProcess()
Retrieve the set of all the files that have to be processed.

Returns:
all files to process

isPartialScan

public boolean isPartialScan()
Check if the last scan was interrupted because the maximum number of file per scan was reached.

Returns:
true if the directory scan was interrupted, false if it completed till the end.
Since:
jcms-7.0

getLastScanEndDate

public Date getLastScanEndDate()
Retrieve the last scan date

Returns:
a date or null if no scan occured

getLastScanDuration

public long getLastScanDuration()
Retrieve the last scan duration

Returns:
a duration in millis

getLastScanFileCount

public long getLastScanFileCount()
Retrieve the number of files found in the last scan

Returns:
a file count


Copyright © 2001-2010 Jalios SA. All Rights Reserved.