NetKernel APIs


com.ten60.netkernel.module.accessor
Class ModuleResourceRepresentation

java.lang.Object
  extended bycom.ten60.netkernel.urii.representation.SimpleRepresentationImpl
      extended bycom.ten60.netkernel.module.accessor.ModuleResourceRepresentation
All Implemented Interfaces:
IAspectBinaryStream, IAspectReadableBinaryStream, IURAspect, IURRepresentation

public final class ModuleResourceRepresentation
extends SimpleRepresentationImpl
implements IAspectReadableBinaryStream

The representation returned by the module resource accessor. It is based on SimpleRepresentationImpl which means the aspect and representation are rolled into one object.


Field Summary
 
Fields inherited from class com.ten60.netkernel.urii.representation.SimpleRepresentationImpl
mMeta
 
Constructor Summary
ModuleResourceRepresentation(String aPath, ModuleDefinition aModule, Container aContainer, long aExpiryOffset)
          Creates a new instance of ModuleResourceRepresentation
 
Method Summary
 int getContentLength()
          return the length of the resource
 String getEncoding()
          returns a guess at the encoding if the resource is text
 InputStream getInputStream()
          get an input stream for the resource
 void write(OutputStream aStream)
          write the resource to the given output stream
 
Methods inherited from class com.ten60.netkernel.urii.representation.SimpleRepresentationImpl
getAspect, getAspects, getMeta, hasAspect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleResourceRepresentation

public ModuleResourceRepresentation(String aPath,
                                    ModuleDefinition aModule,
                                    Container aContainer,
                                    long aExpiryOffset)
                             throws IOException
Creates a new instance of ModuleResourceRepresentation

Method Detail

getContentLength

public int getContentLength()
return the length of the resource

Specified by:
getContentLength in interface IAspectReadableBinaryStream

write

public void write(OutputStream aStream)
           throws IOException
write the resource to the given output stream

Specified by:
write in interface IAspectBinaryStream
Parameters:
aStream - the output stream
Throws:
IOException - thrown if we fail to write

getInputStream

public InputStream getInputStream()
                           throws IOException
get an input stream for the resource

Specified by:
getInputStream in interface IAspectReadableBinaryStream
Throws:
IOException

getEncoding

public String getEncoding()
returns a guess at the encoding if the resource is text

Specified by:
getEncoding in interface IAspectBinaryStream

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.