public interface Resource extends Serializable
Generic interface to provide a Reader or InputStream for the underlying IO resource.
Modifier and Type | Method and Description |
---|---|
ResourceConfiguration |
getConfiguration() |
InputStream |
getInputStream()
Open an InputStream to the resource, the user must close this when finished.
|
Reader |
getReader()
Opens a Reader to the resource, the user must close this when finished.
|
ResourceType |
getResourceType()
Returns the type of the resource if one could be inferred by the
extension of the resource or if it was explicitly set.
|
String |
getSourcePath() |
String |
getTargetPath() |
Resource |
setConfiguration(ResourceConfiguration conf)
Sets the resource configuration in case it is necessary.
|
Resource |
setResourceType(ResourceType type)
Sets the resource type.
|
Resource |
setSourcePath(String path)
Sets this resource name.
|
Resource |
setTargetPath(String path)
In case this resource should be written to a different path
when writing it down to the KieFileSystem, this property
allows the application to set such path.
|
InputStream getInputStream() throws IOException
IOException
Reader getReader() throws IOException
IOException
String getSourcePath()
String getTargetPath()
ResourceType getResourceType()
ResourceConfiguration getConfiguration()
Resource setSourcePath(String path)
path
- the path of the resourceResource setTargetPath(String path)
path
- the path of the resourceResource setResourceType(ResourceType type)
type
- the resource typeResource setConfiguration(ResourceConfiguration conf)
conf
- the resource configurationCopyright © 2001–2017 JBoss by Red Hat. All rights reserved.