org.drools.io.impl
Class EncodedResource

java.lang.Object
  extended by org.drools.io.impl.BaseResource
      extended by org.drools.io.impl.EncodedResource
All Implemented Interfaces:
Serializable, InternalResource, org.drools.io.Resource

public class EncodedResource
extends BaseResource
implements InternalResource

See Also:
Serialized Form

Constructor Summary
EncodedResource(org.drools.io.Resource resource)
          Create a new EncodedResource for the given Resource, not specifying a specific encoding.
EncodedResource(org.drools.io.Resource resource, String encoding)
          Create a new EncodedResource for the given Resource, using the specified encoding.
 
Method Summary
 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.drools.io.Resource getResource()
          Return the Resource held.
 URL getURL()
           
 boolean hasURL()
           
 boolean isDirectory()
           
 Collection<org.drools.io.Resource> listResources()
           
 String toString()
           
 
Methods inherited from class org.drools.io.impl.BaseResource
getConfiguration, getResourceType, setConfiguration, setResourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.io.internal.InternalResource
getConfiguration, getResourceType, setConfiguration, setResourceType
 

Constructor Detail

EncodedResource

public EncodedResource(org.drools.io.Resource resource)
Create a new EncodedResource for the given Resource, not specifying a specific encoding.

Parameters:
resource - the Resource to hold

EncodedResource

public EncodedResource(org.drools.io.Resource resource,
                       String encoding)
Create a new EncodedResource for the given Resource, using the specified encoding.

Parameters:
resource - the Resource to hold
encoding - the encoding to use for reading from the resource
Method Detail

getURL

public URL getURL()
           throws IOException
Specified by:
getURL in interface InternalResource
Throws:
IOException

hasURL

public boolean hasURL()
Specified by:
hasURL in interface InternalResource

getResource

public final org.drools.io.Resource getResource()
Return the Resource held.


getEncoding

public final String getEncoding()
Return the encoding to use for reading from the resource, or null if none specified.


getReader

public Reader getReader()
                 throws IOException
Open a java.io.Reader for the specified resource, using the specified encoding (if any).

Specified by:
getReader in interface org.drools.io.Resource
Throws:
IOException - if opening the Reader failed

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface org.drools.io.Resource
Throws:
IOException

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface InternalResource

getLastRead

public long getLastRead()
Specified by:
getLastRead in interface InternalResource

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in interface InternalResource

listResources

public Collection<org.drools.io.Resource> listResources()
Specified by:
listResources in interface InternalResource

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.