|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.fileinstall.internal.Scanner
public class Scanner
A Scanner object is able to detect and report new, modified and deleted files. The scanner use an internal checksum to identify the signature of a file or directory. The checksum will change if the file or any of the directory's child is modified. In addition, if the scanner detects a change on a given file, it will wait until the checksum does not change anymore before reporting the change on this file. This allows to not report the change until a big copy if complete for example.
Constructor Summary | |
---|---|
Scanner(File directory)
Create a scanner for the specified directory |
|
Scanner(File directory,
FilenameFilter filter)
Create a scanner for the specified directory and file filter |
Method Summary | |
---|---|
long |
getChecksum(File file)
Retrieve the previously computed checksum for a give file. |
void |
initialize(Map checksums)
Initialize the list of known files. |
Set |
scan(boolean reportImmediately)
Report a set of new, modified or deleted files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Scanner(File directory)
directory
- the directory to scanpublic Scanner(File directory, FilenameFilter filter)
directory
- the directory to scanfilter
- a filter for file namesMethod Detail |
---|
public void initialize(Map checksums)
checksums
- a map of checksumspublic Set scan(boolean reportImmediately)
reportImmediately
- report all files immediately without waiting for the checksum to be stable
public long getChecksum(File file)
file
- the file to retrieve the checksum
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |