public class EncodedResource extends BaseResource implements InternalResource, Externalizable
Constructor and Description |
---|
EncodedResource(org.kie.api.io.Resource resource)
Create a new EncodedResource for the given Resource,
not specifying a specific encoding.
|
EncodedResource(org.kie.api.io.Resource resource,
String encoding)
Create a new EncodedResource for the given Resource,
using the specified encoding.
|
Modifier and Type | Method and Description |
---|---|
String |
getEncoding()
Return the encoding to use for reading from the resource,
or
null if none specified. |
InputStream |
getInputStream() |
long |
getLastModified() |
long |
getLastRead() |
Reader |
getReader()
Open a
java.io.Reader for the specified resource,
using the specified encoding (if any). |
org.kie.api.io.Resource |
getResource()
Return the Resource held.
|
URL |
getURL() |
boolean |
hasURL() |
boolean |
isDirectory() |
Collection<org.kie.api.io.Resource> |
listResources() |
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
addCategory, equals, getBytes, getCategories, getConfiguration, getDescription, getResourceType, getSourcePath, getTargetPath, hashCode, setCategories, setConfiguration, setDescription, setResourceType, setSourcePath, setTargetPath
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addCategory, getBytes, getCategories, getConfiguration, getDescription, getResourceType, setCategories, setConfiguration, setDescription, setResourceType
public EncodedResource(org.kie.api.io.Resource resource)
resource
- the Resource to holdpublic EncodedResource(org.kie.api.io.Resource resource, String encoding)
resource
- the Resource to holdencoding
- the encoding to use for reading from the resourcepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class BaseResource
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class BaseResource
IOException
public URL getURL() throws IOException
getURL
in interface InternalResource
IOException
public boolean hasURL()
hasURL
in interface InternalResource
public final org.kie.api.io.Resource getResource()
public final String getEncoding()
null
if none specified.getEncoding
in interface InternalResource
public Reader getReader() throws IOException
java.io.Reader
for the specified resource,
using the specified encoding (if any).getReader
in interface org.kie.api.io.Resource
IOException
- if opening the Reader failedpublic InputStream getInputStream() throws IOException
getInputStream
in interface org.kie.api.io.Resource
IOException
public long getLastModified()
getLastModified
in interface InternalResource
public long getLastRead()
getLastRead
in interface InternalResource
public boolean isDirectory()
isDirectory
in interface InternalResource
public Collection<org.kie.api.io.Resource> listResources()
listResources
in interface InternalResource
public String toString()
toString
in class BaseResource
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.