类 JarContent
- java.lang.Object
-
- org.apache.felix.framework.cache.JarContent
-
-
构造器概要
构造器 构造器 说明 JarContent(Logger logger, java.util.Map configMap, WeakZipFileFactory zipFactory, java.lang.Object revisionLock, java.io.File rootDir, java.io.File file, WeakZipFileFactory.WeakZipFile zipFile)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclose()This method must be called when the content is no longer needed so that any resourses being used (e.g., open files) can be closed.protected voidfinalize()java.util.Enumeration<java.lang.String>getEntries()Returns an enumeration of entry names as String objects.byte[]getEntryAsBytes(java.lang.String name)This method returns the named entry as an array of bytes.ContentgetEntryAsContent(java.lang.String entryName)This method returns the named entry as an IContent Typically, this method only makes sense for entries that correspond to some form of aggregated resource (e.g., an embedded JAR file or directory), but implementations are free to interpret this however makes sense.java.lang.StringgetEntryAsNativeLibrary(java.lang.String entryName)This method returns the named entry as a file in the file system for use as a native library.java.io.InputStreamgetEntryAsStream(java.lang.String name)This method returns the named entry as an input stream.java.net.URLgetEntryAsURL(java.lang.String name)This method allows retrieving an entry as a local URL.java.io.FilegetFile()booleanhasEntry(java.lang.String name)This method determines if the specified named entry is contained in the associated content.java.lang.StringtoString()
-
-
-
构造器详细资料
-
JarContent
public JarContent(Logger logger, java.util.Map configMap, WeakZipFileFactory zipFactory, java.lang.Object revisionLock, java.io.File rootDir, java.io.File file, WeakZipFileFactory.WeakZipFile zipFile)
-
-
方法详细资料
-
finalize
protected void finalize()
- 覆盖:
finalize在类中java.lang.Object
-
close
public void close()
从接口复制的说明:ContentThis method must be called when the content is no longer needed so that any resourses being used (e.g., open files) can be closed. Once this method is called, the content is no longer usable. If the content is already closed, then calls on this method should have no effect.
-
hasEntry
public boolean hasEntry(java.lang.String name) throws java.lang.IllegalStateException从接口复制的说明:ContentThis method determines if the specified named entry is contained in the associated content. The entry name is a relative path with '/' separators.
-
getEntries
public java.util.Enumeration<java.lang.String> getEntries()
从接口复制的说明:ContentReturns an enumeration of entry names as String objects. An entry name is a path constructed with '/' as path element separators and is relative to the root of the content. Entry names for entries that represent directories should end with the '/' character.
- 指定者:
getEntries在接口中Content
-
getEntryAsBytes
public byte[] getEntryAsBytes(java.lang.String name) throws java.lang.IllegalStateException从接口复制的说明:ContentThis method returns the named entry as an array of bytes.
- 指定者:
getEntryAsBytes在接口中Content- 参数:
name- The name of the entry to retrieve as a byte array.- 返回:
- An array of bytes if the corresponding entry was found, null otherwise.
- 抛出:
java.lang.IllegalStateException
-
getEntryAsStream
public java.io.InputStream getEntryAsStream(java.lang.String name) throws java.lang.IllegalStateException, java.io.IOException从接口复制的说明:ContentThis method returns the named entry as an input stream.
- 指定者:
getEntryAsStream在接口中Content- 参数:
name- The name of the entry to retrieve as an input stream.- 返回:
- An input stream if the corresponding entry was found, null otherwise.
- 抛出:
java.lang.IllegalStateExceptionjava.io.IOException
-
getEntryAsURL
public java.net.URL getEntryAsURL(java.lang.String name)
从接口复制的说明:ContentThis method allows retrieving an entry as a local URL.
- 指定者:
getEntryAsURL在接口中Content- 参数:
name- The name of the entry to retrieve as a URL- 返回:
- A URL using a local protocol such as file, jar or null if not possible.
-
getEntryAsContent
public Content getEntryAsContent(java.lang.String entryName)
从接口复制的说明:ContentThis method returns the named entry as an IContent Typically, this method only makes sense for entries that correspond to some form of aggregated resource (e.g., an embedded JAR file or directory), but implementations are free to interpret this however makes sense. This method should return a new IContent instance for every invocation and the caller is responsible for opening and closing the returned content object.
- 指定者:
getEntryAsContent在接口中Content- 参数:
entryName- The name of the entry to retrieve as an IContent.- 返回:
- An IContent instance if a corresponding entry was found, null otherwise.
-
getEntryAsNativeLibrary
public java.lang.String getEntryAsNativeLibrary(java.lang.String entryName)
从接口复制的说明:ContentThis method returns the named entry as a file in the file system for use as a native library. It may not be possible for all content implementations (e.g., memory only) to implement this method, in which case it is acceptable to return null. Since native libraries can only be associated with a single class loader, this method should return a unique file per request.
- 指定者:
getEntryAsNativeLibrary在接口中Content- 参数:
entryName- The name of the entry to retrieve as a file.- 返回:
- A string corresponding to the absolute path of the file if a corresponding entry was found, null otherwise.
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
getFile
public java.io.File getFile()
-
-