| Modifier and Type | Field and Description |
|---|---|
| private final BitSet | |
| private final BitSet | |
| private static final int | HASH_PRIME_1
Constant used by a typical hashing method. |
| private static final int | HASH_PRIME_2
Constant used by a typical hashing method. |
| private static final int | TABLE_SIZE
Size of the fixed-length bit table. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| private int | |
| public boolean | Returns: Whether the prefix of the path is known to be in this jar.Requested path. Sometimes starts with "/WEB-INF/classes". path, String The value of the webapp location, which can be stripped from the path. Typically is
"/WEB-INF/classes". webappRoot)Method that identifies whether a given path MIGHT be in this jar. |
| bits1 | back to summary |
|---|---|
| private final BitSet bits1 | |
| bits2 | back to summary |
|---|---|
| private final BitSet bits2 | |
| HASH_PRIME_1 | back to summary |
|---|---|
| private static final int HASH_PRIME_1 Constant used by a typical hashing method. | |
| HASH_PRIME_2 | back to summary |
|---|---|
| private static final int HASH_PRIME_2 Constant used by a typical hashing method. | |
| TABLE_SIZE | back to summary |
|---|---|
| private static final int TABLE_SIZE Size of the fixed-length bit table. Larger reduces false positives, smaller saves memory. | |
| JarContents | back to summary |
|---|---|
| public JarContents(JarFile jar) Parses the passed-in jar and populates the bit array.
| |
| hashcode | back to summary |
|---|---|
| private int hashcode(String content, int startPos, int hashPrime) Simple hashcode of a portion of the string. Typically we would use substring, but memory and runtime speed are critical.
| |
| hashcode | back to summary |
|---|---|
| private int hashcode(String content, int startPos, int endPos, int hashPrime) | |
| mightContainResource | back to summary |
|---|---|
| public boolean mightContainResource(String path, String webappRoot) Method that identifies whether a given path MIGHT be in this jar. Uses the Bloom filter mechanism. | |