Package org.apache.tomcat.util.scan
Class ReferenceCountedJar
java.lang.Object
org.apache.tomcat.util.scan.ReferenceCountedJar
- All Implemented Interfaces:
- AutoCloseable,- Jar
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close any resources associated with this JAR.booleanDetermine if the given resource in present in the JAR.Obtains the input stream for the current entry.Obtains the name of the current entry.getInputStream(String name) Obtain anInputStreamfor a given entry in a JAR.longgetLastModified(String name) Obtain the last modified time for the given resource in the JAR.Obtain the manifest for the JAR file.Obtain, in String form, the URL for an entry in this JAR.voidMoves the internal pointer to the next entry in the JAR.voidreset()Resets the internal pointer used to track JAR entries to the beginning of the JAR.
- 
Constructor Details- 
ReferenceCountedJar- Throws:
- IOException
 
 
- 
- 
Method Details- 
closepublic void close()Description copied from interface:JarClose any resources associated with this JAR.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Jar
 
- 
getJarFileURL- Specified by:
- getJarFileURLin interface- Jar
- Returns:
- The URL for accessing the JAR file.
 
- 
getInputStreamDescription copied from interface:JarObtain anInputStreamfor a given entry in a JAR. The caller is responsible for closing the stream.- Specified by:
- getInputStreamin interface- Jar
- Parameters:
- name- Entry to obtain an- InputStreamfor
- Returns:
- An InputStreamfor the specified entry or null if the entry does not exist
- Throws:
- IOException- if an I/O error occurs while processing the JAR file
 
- 
getLastModifiedDescription copied from interface:JarObtain the last modified time for the given resource in the JAR.- Specified by:
- getLastModifiedin interface- Jar
- Parameters:
- name- Entry to obtain the modification time for
- Returns:
- The time (in the same format as
         System.currentTimeMillis()that the resource was last modified. Returns -1 if the entry does not exist
- Throws:
- IOException- if an I/O error occurs while processing the JAR file
 
- 
existsDescription copied from interface:JarDetermine if the given resource in present in the JAR.- Specified by:
- existsin interface- Jar
- Parameters:
- name- Entry to look for
- Returns:
- trueif the entry is present in the JAR, otherwise- false
- Throws:
- IOException- if an I/O error occurs while processing the JAR file
 
- 
nextEntrypublic void nextEntry()Description copied from interface:JarMoves the internal pointer to the next entry in the JAR.
- 
getEntryNameDescription copied from interface:JarObtains the name of the current entry.- Specified by:
- getEntryNamein interface- Jar
- Returns:
- The entry name
 
- 
getEntryInputStreamDescription copied from interface:JarObtains the input stream for the current entry.- Specified by:
- getEntryInputStreamin interface- Jar
- Returns:
- The input stream
- Throws:
- IOException- If the stream cannot be obtained
 
- 
getURLDescription copied from interface:JarObtain, in String form, the URL for an entry in this JAR. Note that for JARs nested in WAR files, the Tomcat specific war:file:... form will not be used, rather the jar:jar:file:... form (that the JRE does not understand will be used). Note that this means that any code using these URLs will need to understand the jar:jar:file:... form and use theJarFactoryto ensure resources are accessed correctly.
- 
getManifestDescription copied from interface:JarObtain the manifest for the JAR file.- Specified by:
- getManifestin interface- Jar
- Returns:
- The manifest for this JAR file.
- Throws:
- IOException- If an I/O error occurs trying to obtain the manifest
 
- 
resetDescription copied from interface:JarResets the internal pointer used to track JAR entries to the beginning of the JAR.- Specified by:
- resetin interface- Jar
- Throws:
- IOException- If the pointer cannot be reset
 
 
-