Package ej.rest.web

Class TextResource


  • public class TextResource
    extends AbstractResource
    This is a text/* representation of a resource.
    • Field Detail

    • Constructor Detail

      • TextResource

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

      • toString

        public String toString()
        Kinda obvious, but, yes, it parses the inputStream with the proper charset and returns the content as String
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object.
      • readTextFromStream

        protected String readTextFromStream​(InputStream aTextStream)
      • getAcceptedTypes

        public String getAcceptedTypes()
        Get charset for this content type. Parses charset= attribute of content type or falls back to a default
        Specified by:
        getAcceptedTypes in class AbstractResource
        Returns:
        the charset to use when parsing this content