public class Scanner
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
Scanner(java.io.File directory)
Create a scanner for the specified directory
|
Scanner(java.io.File directory,
java.lang.String filterString)
Create a scanner for the specified directory and file filter
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getChecksum(java.io.File file)
Retrieve the previously computed checksum for a give file.
|
void |
initialize(java.util.Map<java.io.File,java.lang.Long> checksums)
Initialize the list of known files.
|
java.util.Set<java.io.File> |
scan(boolean reportImmediately)
Report a set of new, modified or deleted files.
|
void |
updateChecksum(java.io.File file)
Update the checksum of a file if that file is already known locally.
|
public Scanner(java.io.File directory)
directory
- the directory to scanpublic Scanner(java.io.File directory, java.lang.String filterString)
directory
- the directory to scanfilterString
- a filter for file namespublic void initialize(java.util.Map<java.io.File,java.lang.Long> checksums)
checksums
- a map of checksumspublic java.util.Set<java.io.File> scan(boolean reportImmediately)
reportImmediately
- report all files immediately without waiting for the checksum to be stablepublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public long getChecksum(java.io.File file)
file
- the file to retrieve the checksumpublic void updateChecksum(java.io.File file)
Copyright © 2006-2015 The Apache Software Foundation. All Rights Reserved.