Implementation is threadsafe. Since loading index information is O(jar-entries) we cache the snapshot in a WeakHashMap. The implementation pays attention to lastModified timestamp of the jar and will invalidate the cache entry if jar has been updated since the snapshot calculation.
****************************************************************************************** DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER DANGER ****************************************************************************************** The spec for this cache is disabled currently for #2655, because of last-modified time oddities on CloudBees. Please be cautious modifying this code and make sure you run the associated spec locally.| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final ReferenceQueue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public JarCache. | |
| public void |
| indexCache | back to summary |
|---|---|
| private final Map<String, JarCache. | |
| indexQueue | back to summary |
|---|---|
| private final ReferenceQueue<JarCache. | |
| JarCache | back to summary |
|---|---|
| pack-priv JarCache() | |
| cleanup | back to summary |
|---|---|
| private void cleanup() | |
| getIndex | back to summary |
|---|---|
| public JarCache. | |
| remove | back to summary |
|---|---|
| public void remove(String jarPath) | |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final JarFile | |
| private final long | |
| private Long | |
| private static final String |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public String[] | |
| public InputStream | |
| public JarEntry | |
| private long | Returns: The last modification timestamp.The path to the JAR file. jarPath)Determines the last modification timestamp of a file. |
| public boolean | |
| public void |
| cachedDirEntries | back to summary |
|---|---|
| private final Map<String, String[]> cachedDirEntries | |
| jar | back to summary |
|---|---|
| private final JarFile jar | |
| lastModified | back to summary |
|---|---|
| private final long lastModified | |
| lastModifiedExpiration | back to summary |
|---|---|
| private Long lastModifiedExpiration | |
| ROOT_KEY | back to summary |
|---|---|
| private static final String ROOT_KEY | |
| JarIndex | back to summary |
|---|---|
| pack-priv JarIndex(String jarPath) throws IOException | |
| canonicalJarPath | back to summary |
|---|---|
| private static String canonicalJarPath(String path) | |
| getDirEntries | back to summary |
|---|---|
| public String[] getDirEntries(String entryPath) | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream(JarEntry entry) throws IOException, IllegalStateException | |
| getJarEntry | back to summary |
|---|---|
| public JarEntry getJarEntry(String entryPath) | |
| getLastModified | back to summary |
|---|---|
| private long getLastModified(String jarPath) Determines the last modification timestamp of a file. Note Getting the value is an expensive operation on Windows systems (see
| |
| isValid | back to summary |
|---|---|
| public boolean isValid() | |
| release | back to summary |
|---|---|
| public void release() | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| key | back to summary |
|---|---|
| private final String key | |
| SoftJarIndex | back to summary |
|---|---|
| public SoftJarIndex(String key, JarCache. | |
| getKey | back to summary |
|---|---|
| public String getKey() | |