org.jboss.osgi.resolver.v2.spi
Class URLBasedResource
java.lang.Object
org.jboss.osgi.resolver.v2.spi.AbstractResource
org.jboss.osgi.resolver.v2.spi.URLBasedResource
- All Implemented Interfaces:
- XAttachmentSupport, XElement, XResource, org.osgi.framework.resource.Resource
public final class URLBasedResource
- extends AbstractResource
A resource based on an URL
- Since:
- 16-Jan-2012
- Author:
- thomas.diesler@jboss.com
URLBasedResource
public URLBasedResource(URL baseURL,
String contentPath)
getContentURL
public URL getContentURL()
getContentPath
public String getContentPath()
getContent
public InputStream getContent()
- Specified by:
getContent in interface XResource- Overrides:
getContent in class AbstractResource
addAttachment
public <T> T addAttachment(Class<T> clazz,
T value)
- Description copied from interface:
XAttachmentSupport
- Attach an arbirtary object with this element.
- Specified by:
addAttachment in interface XAttachmentSupport
- Parameters:
clazz - key for the attachment
- Returns:
- The previously attachment object or null
getAttachment
public <T> T getAttachment(Class<T> clazz)
- Description copied from interface:
XAttachmentSupport
- Get the attached object for a given key
- Specified by:
getAttachment in interface XAttachmentSupport
- Parameters:
clazz - key for the attachment
- Returns:
- The attached object or null
removeAttachment
public <T> T removeAttachment(Class<T> clazz)
- Description copied from interface:
XAttachmentSupport
- Remove an attached object for a given key
- Specified by:
removeAttachment in interface XAttachmentSupport
- Parameters:
clazz - key for the attachment
- Returns:
- The attached object or null
Copyright © 2012. All Rights Reserved.