Package ej.rest.web

Class 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
    • Constructor Detail

      • AbstractResource

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

      • getAcceptedTypes

        protected abstract String getAcceptedTypes()
      • 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.
      • printResponseHeaders

        public String printResponseHeaders()
        Print out the response headers for this resource.
        Returns: