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, setTargetPathclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddCategory, getBytes, getCategories, getConfiguration, getDescription, getResourceType, setCategories, setConfiguration, setDescription, setResourceTypepublic 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 ExternalizablereadExternal in class BaseResourceIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class BaseResourceIOExceptionpublic URL getURL() throws IOException
getURL in interface InternalResourceIOExceptionpublic boolean hasURL()
hasURL in interface InternalResourcepublic final org.kie.api.io.Resource getResource()
public final String getEncoding()
null if none specified.getEncoding in interface InternalResourcepublic Reader getReader() throws IOException
java.io.Reader for the specified resource,
using the specified encoding (if any).getReader in interface org.kie.api.io.ResourceIOException - if opening the Reader failedpublic InputStream getInputStream() throws IOException
getInputStream in interface org.kie.api.io.ResourceIOExceptionpublic long getLastModified()
getLastModified in interface InternalResourcepublic long getLastRead()
getLastRead in interface InternalResourcepublic boolean isDirectory()
isDirectory in interface InternalResourcepublic Collection<org.kie.api.io.Resource> listResources()
listResources in interface InternalResourcepublic String toString()
toString in class BaseResourceCopyright © 2001–2018 JBoss by Red Hat. All rights reserved.