Class StringResource

java.lang.Object
com.djrapitops.plan.storage.file.StringResource
All Implemented Interfaces:
Resource

public class StringResource extends Object implements Resource
Resource implementation for a String.
  • Method Details

    • getResourceName

      public 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.
    • getLastModifiedDate

      public long getLastModifiedDate()
      Specified by:
      getLastModifiedDate in interface Resource
    • asInputStream

      public InputStream asInputStream()
      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.
    • asLines

      public List<String> asLines()
      Description copied from interface: Resource
      Get the resource as lines.
      Specified by:
      asLines in interface Resource
      Returns:
      Lines of the resource file.
    • asString

      public String asString()
      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.
    • asBytes

      public byte[] asBytes()
      Specified by:
      asBytes in interface Resource