Class JarResource

  • All Implemented Interfaces:
    Resource

    public class JarResource
    extends java.lang.Object
    implements Resource
    Resource implementation for something that is read via InputStream.
    • Method Detail

      • asInputStream

        public java.io.InputStream asInputStream()
                                          throws java.io.IOException
        Description copied from interface: Resource
        Get the resource as an InputStream.
        Specified by:
        asInputStream in interface Resource
        Returns:
        InputStream of the resource, not closed automatically.
        Throws:
        java.io.IOException - If the resource is unavailable.
      • asLines

        public java.util.List<java.lang.String> asLines()
                                                 throws java.io.IOException
        Description copied from interface: Resource
        Get the resource as lines.
        Specified by:
        asLines in interface Resource
        Returns:
        Lines of the resource file.
        Throws:
        java.io.IOException - If the resource is unavailable.
      • asString

        public java.lang.String asString()
                                  throws java.io.IOException
        Description copied from interface: Resource
        Get the resource as a String with each line separated by CRLF newline characters \r\n.
        Specified by:
        asString in interface Resource
        Returns:
        Flat string with each line separated by \r\n.
        Throws:
        java.io.IOException - If the resource is unavailable.
      • asBytes

        public byte[] asBytes()
                       throws java.io.IOException
        Specified by:
        asBytes in interface Resource
        Throws:
        java.io.IOException
      • getResourceName

        public java.lang.String getResourceName()
        Description copied from interface: Resource
        Get the name of this Resource.
        Specified by:
        getResourceName in interface Resource
        Returns:
        Relative file path given to PlanFiles.