|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.modzdetector.HashRegistry
public class HashRegistry
Represents a stateful hash registry to which resources can be cumulatively added
using register(String, java.io.InputStream). Its operation is modal. By default
resources are registered as filesystem loadable resources. Calling setClasspathMode()
means subsequent registrations indicate that resources are to be loaded from the claspath
when modifications or removals are to be detected.
| Field Summary | |
|---|---|
static java.lang.String |
PREFIX_CLASSPATH
Indicates that the name is registered as a classpath resource. |
static java.lang.String |
PREFIX_FILESYSTEM
Indicates that the name is registered as a filesystem resource. |
| Constructor Summary | |
|---|---|
HashRegistry()
Constructor using default algorithm and file name. |
|
HashRegistry(HashAlgorithm algorithm,
java.lang.String fileName)
Creates a HashRegistry that uses the given algorithm and filename. |
|
HashRegistry(java.lang.String fileName)
|
|
| Method Summary | |
|---|---|
void |
register(java.lang.String name,
java.io.InputStream contents)
Registers a hash for the resource with the given name and contents. |
void |
registerFilesystem(java.io.File root,
java.io.FileFilter filter)
Registers a whole filesystem under the given root for each file that matches filter. |
void |
registerFilesystm(java.io.File root)
Registers a whole filesystem under the given root. |
void |
setClasspathMode()
|
void |
setFilesystemMode()
|
java.io.File |
store()
Writes the registry to a file with the configured name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PREFIX_CLASSPATH
public static final java.lang.String PREFIX_FILESYSTEM
| Constructor Detail |
|---|
public HashRegistry()
public HashRegistry(java.lang.String fileName)
public HashRegistry(HashAlgorithm algorithm,
java.lang.String fileName)
algorithm - the hashing algorithm.fileName - the filename to write the registry to.| Method Detail |
|---|
public void setClasspathMode()
public void setFilesystemMode()
public void register(java.lang.String name,
java.io.InputStream contents)
name - the name of the resource relative to a cwd or docroot.contents - will be closed before this method completes.public void registerFilesystm(java.io.File root)
root - the root of the filesystem to register.
public void registerFilesystem(java.io.File root,
java.io.FileFilter filter)
root - the root of the filesystem to register.filter - the filter that all files must match in order to be registered.
public java.io.File store()
throws java.io.IOException
File written to.
java.io.IOException - if the file cannot be written.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||