net.fortytwo.linkeddata.dereferencers
Class HTTPRepresentation

java.lang.Object
  extended by org.restlet.representation.Variant
      extended by org.restlet.representation.RepresentationInfo
          extended by org.restlet.representation.Representation
              extended by org.restlet.representation.StreamRepresentation
                  extended by net.fortytwo.linkeddata.dereferencers.HTTPRepresentation

public class HTTPRepresentation
extends org.restlet.representation.StreamRepresentation

Author:
Joshua Shinavier (http://fortytwo.net)

Nested Class Summary
 class HTTPRepresentation.ErrorResponseException
           
 class HTTPRepresentation.InvalidResponseException
           
 
Field Summary
 
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE
 
Constructor Summary
HTTPRepresentation(String uri, String acceptHeader)
           
 
Method Summary
 ReadableByteChannel getChannel()
           
 long getIdleTime()
           
 org.apache.commons.httpclient.HttpMethod getMethod()
           
 InputStream getStream()
           
 void write(OutputStream outputStream)
           
 void write(WritableByteChannel writableByteChannel)
           
 
Methods inherited from class org.restlet.representation.StreamRepresentation
getReader, write
 
Methods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
 
Methods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTag
 
Methods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPRepresentation

public HTTPRepresentation(String uri,
                          String acceptHeader)
                   throws net.fortytwo.ripple.RippleException
Throws:
net.fortytwo.ripple.RippleException
Method Detail

getChannel

public ReadableByteChannel getChannel()
                               throws IOException
Overrides:
getChannel in class org.restlet.representation.StreamRepresentation
Throws:
IOException

getStream

public InputStream getStream()
                      throws IOException
Specified by:
getStream in class org.restlet.representation.Representation
Throws:
IOException

getMethod

public org.apache.commons.httpclient.HttpMethod getMethod()
Returns:
the HTTP method of this representation. This class is generally used as an internal component of LinkedDataSail, but it can also be used as a standalone tool for dereferencing Linked Data URIs, in which case access to HTTP headers and status data is useful.

getIdleTime

public long getIdleTime()
Returns:
the amount of time, in milliseconds, which was spent on a courtesy delay (to avoid overloading remote servers) while creating this representation, as opposed to time spent waiting for a response from the remote server or receiving packet data. This is important for accurate response time analysis.

write

public void write(OutputStream outputStream)
           throws IOException
Specified by:
write in class org.restlet.representation.Representation
Throws:
IOException

write

public void write(WritableByteChannel writableByteChannel)
           throws IOException
Overrides:
write in class org.restlet.representation.StreamRepresentation
Throws:
IOException


Copyright © 2007-2013. All Rights Reserved.