|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.framework.cache.ContentDirectoryContent
public class ContentDirectoryContent
Constructor Summary | |
---|---|
ContentDirectoryContent(Content content,
java.lang.String path)
|
Method Summary | |
---|---|
void |
close()
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. |
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. |
Content |
getEntryAsContent(java.lang.String name)
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.String |
getEntryAsNativeLibrary(java.lang.String name)
This method returns the named entry as a file in the file system for use as a native library. |
java.io.InputStream |
getEntryAsStream(java.lang.String name)
This method returns the named entry as an input stream. |
java.net.URL |
getEntryAsURL(java.lang.String name)
This method allows retrieving an entry as a local URL. |
boolean |
hasEntry(java.lang.String name)
This method determines if the specified named entry is contained in the associated content. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContentDirectoryContent(Content content, java.lang.String path)
Method Detail |
---|
public void close()
Content
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. 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.
close
in interface Content
public boolean hasEntry(java.lang.String name) throws java.lang.IllegalStateException
Content
This method determines if the specified named entry is contained in the associated content. The entry name is a relative path with '/' separators.
hasEntry
in interface Content
name
- The name of the entry to find.
java.lang.IllegalStateException
public java.util.Enumeration<java.lang.String> getEntries()
Content
Returns 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
in interface Content
public byte[] getEntryAsBytes(java.lang.String name) throws java.lang.IllegalStateException
Content
This method returns the named entry as an array of bytes.
getEntryAsBytes
in interface Content
name
- The name of the entry to retrieve as a byte array.
java.lang.IllegalStateException
public java.io.InputStream getEntryAsStream(java.lang.String name) throws java.lang.IllegalStateException, java.io.IOException
Content
This method returns the named entry as an input stream.
getEntryAsStream
in interface Content
name
- The name of the entry to retrieve as an input stream.
java.lang.IllegalStateException
java.io.IOException
public java.net.URL getEntryAsURL(java.lang.String name)
Content
This method allows retrieving an entry as a local URL.
getEntryAsURL
in interface Content
name
- The name of the entry to retrieve as a URL
public Content getEntryAsContent(java.lang.String name)
Content
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. 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
in interface Content
name
- The name of the entry to retrieve as an IContent.
public java.lang.String getEntryAsNativeLibrary(java.lang.String name)
Content
This 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
in interface Content
name
- The name of the entry to retrieve as a file.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |