|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.io.AbstractResource
org.springframework.osgi.io.OsgiBundleResource
public class OsgiBundleResource
Resource implementation for OSGi environments.
Lazy evaluation of the resource will be used. This implementation allows resource location inside:BUNDLE_URL_PREFIX
prefix is being used or
none is specifiedBUNDLE_JAR_URL_PREFIX
is specifiedResourceUtils.CLASSPATH_URL_PREFIX
is
encounteredOsgiBundleResourcePatternResolver
to retrieve all entries.
Field Summary | |
---|---|
static String |
BUNDLE_JAR_URL_PREFIX
Prefix for searching only the bundle raw jar. |
static String |
BUNDLE_URL_PREFIX
Prefix for searching inside the owning bundle space. |
Constructor Summary | |
---|---|
OsgiBundleResource(Bundle bundle,
String path)
|
Method Summary | |
---|---|
Resource |
createRelative(String relativePath)
This implementation creates a OsgiBundleResource, applying the given path relative to the path of the underlying resource of this descriptor. |
boolean |
equals(Object obj)
This implementation compares the underlying bundle and path locations. |
String |
getDescription()
This implementation returns a description that includes the bundle location. |
File |
getFile()
|
String |
getFilename()
This implementation returns the name of the file that this bundle path resource refers to. |
InputStream |
getInputStream()
This implementation opens an InputStream for the given URL. |
URL |
getURL()
Locates the resource in the underlying bundle based on the prefix, if it exists. |
int |
hashCode()
This implementation returns the hash code of the underlying class path location. |
Methods inherited from class org.springframework.core.io.AbstractResource |
---|
exists, getURI, isOpen, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String BUNDLE_URL_PREFIX
public static final String BUNDLE_JAR_URL_PREFIX
Constructor Detail |
---|
public OsgiBundleResource(Bundle bundle, String path)
Method Detail |
---|
public InputStream getInputStream() throws IOException
false
, mainly to avoid jar file
locking on Windows.
IOException
URL.openConnection()
,
URLConnection.setUseCaches(boolean)
,
URLConnection.getInputStream()
public URL getURL() throws IOException
getURL
in interface Resource
getURL
in class AbstractResource
IOException
Bundle.getEntry(String)
,
Bundle.getResource(String)
public Resource createRelative(String relativePath)
createRelative
in interface Resource
createRelative
in class AbstractResource
StringUtils.applyRelativePath(String,
String)
public String getFilename()
getFilename
in interface Resource
getFilename
in class AbstractResource
StringUtils.getFilename(String)
public File getFile() throws IOException
getFile
in interface Resource
getFile
in class AbstractResource
IOException
public String getDescription()
public boolean equals(Object obj)
equals
in class AbstractResource
public int hashCode()
hashCode
in class AbstractResource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |