parent
115a72da65
commit
90e48ba0b5
|
@ -112,7 +112,7 @@ public class Scanner extends AbstractLifeCycle
|
||||||
* MetaData
|
* MetaData
|
||||||
*
|
*
|
||||||
* Metadata about a file: Last modified time, file size and
|
* Metadata about a file: Last modified time, file size and
|
||||||
* last file status (ADDED, CHANGED, DELETED)
|
* last file status (ADDED, CHANGED, DELETED, STABLE)
|
||||||
*/
|
*/
|
||||||
static class MetaData
|
static class MetaData
|
||||||
{
|
{
|
||||||
|
@ -320,7 +320,7 @@ public class Scanner extends AbstractLifeCycle
|
||||||
schedule();
|
schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setScanDirs(List<File> dirs) throws IOException
|
public void setScanDirs(List<File> dirs)
|
||||||
{
|
{
|
||||||
if (isRunning())
|
if (isRunning())
|
||||||
throw new IllegalStateException("Scanner started");
|
throw new IllegalStateException("Scanner started");
|
||||||
|
@ -341,9 +341,8 @@ public class Scanner extends AbstractLifeCycle
|
||||||
* Add a file to be scanned. The file must not be null, and must exist.
|
* Add a file to be scanned. The file must not be null, and must exist.
|
||||||
*
|
*
|
||||||
* @param p the Path of the file to scan.
|
* @param p the Path of the file to scan.
|
||||||
* @throws IOException
|
|
||||||
*/
|
*/
|
||||||
public void addFile(Path p) throws IOException
|
public void addFile(Path p)
|
||||||
{
|
{
|
||||||
if (isRunning())
|
if (isRunning())
|
||||||
throw new IllegalStateException("Scanner started");
|
throw new IllegalStateException("Scanner started");
|
||||||
|
@ -353,7 +352,7 @@ public class Scanner extends AbstractLifeCycle
|
||||||
|
|
||||||
File f = p.toFile();
|
File f = p.toFile();
|
||||||
if (!f.exists() || f.isDirectory())
|
if (!f.exists() || f.isDirectory())
|
||||||
throw new IllegalStateException("Not file or doesn't exist: " + f.getCanonicalPath());
|
throw new IllegalStateException("Not file or doesn't exist: " + p);
|
||||||
|
|
||||||
_scannables.putIfAbsent(p, null);
|
_scannables.putIfAbsent(p, null);
|
||||||
}
|
}
|
||||||
|
@ -363,7 +362,6 @@ public class Scanner extends AbstractLifeCycle
|
||||||
*
|
*
|
||||||
* @param p the directory to scan.
|
* @param p the directory to scan.
|
||||||
* @return an IncludeExcludeSet to which the caller can add PathMatcher patterns to match
|
* @return an IncludeExcludeSet to which the caller can add PathMatcher patterns to match
|
||||||
* @throws IOException
|
|
||||||
*/
|
*/
|
||||||
public IncludeExcludeSet<PathMatcher, Path> addDirectory(Path p)
|
public IncludeExcludeSet<PathMatcher, Path> addDirectory(Path p)
|
||||||
{
|
{
|
||||||
|
@ -820,6 +818,8 @@ public class Scanner extends AbstractLifeCycle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call ScanCycleListeners with start of scan
|
* Call ScanCycleListeners with start of scan
|
||||||
|
*
|
||||||
|
* @param cycle scan count
|
||||||
*/
|
*/
|
||||||
private void reportScanStart(int cycle)
|
private void reportScanStart(int cycle)
|
||||||
{
|
{
|
||||||
|
@ -839,6 +839,8 @@ public class Scanner extends AbstractLifeCycle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call ScanCycleListeners with end of scan.
|
* Call ScanCycleListeners with end of scan.
|
||||||
|
*
|
||||||
|
* @param cycle scan count
|
||||||
*/
|
*/
|
||||||
private void reportScanEnd(int cycle)
|
private void reportScanEnd(int cycle)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue