us.monoid.web
Class AbstractResource

java.lang.Object
  extended by us.monoid.web.Resty
      extended by us.monoid.web.AbstractResource
Direct Known Subclasses:
BinaryResource, JSONResource, TextResource

public abstract class AbstractResource
extends Resty

Abstract base class for all resource handlers you want to use with Resty. It gives access to the underlying URLConnection and the current inputStream

Author:
beders

Nested Class Summary
 
Nested classes/interfaces inherited from class us.monoid.web.Resty
Resty.Option, Resty.Proxy, Resty.Timeout
 
Constructor Summary
AbstractResource(Resty.Option... options)
           
 
Method Summary
 URLConnection getUrlConnection()
           
 HttpURLConnection http()
           
 URI location()
          Get the location header as URI.
 boolean status(int responseCode)
          Check if the URLConnection has returned the specified responseCode
 InputStream stream()
           
 
Methods inherited from class us.monoid.web.Resty
alwaysSend, authenticate, authenticate, authenticateForRealm, bytes, bytes, bytes, bytes, content, content, content, data, data, delete, dontSend, enc, form, form, identifyAsMozilla, identifyAsResty, ignoreAllCerts, json, json, json, json, path, put, setOptions, setProxy, text, text, text, text, withHeader, xml, xml, xml, xml, xpath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResource

public AbstractResource(Resty.Option... options)
Method Detail

getUrlConnection

public URLConnection getUrlConnection()

http

public HttpURLConnection http()

stream

public InputStream stream()

status

public boolean status(int responseCode)
Check if the URLConnection has returned the specified responseCode

Parameters:
responseCode -
Returns:

location

public URI location()
Get the location header as URI. Returns null if there is no location header.



Copyright © 2013. All Rights Reserved.