Class StringResource

java.lang.Object
org.codehaus.commons.compiler.util.resource.StringResource
All Implemented Interfaces:
Resource

public class StringResource extends Object implements Resource
A resource who's content is a String.
  • Field Details

    • fileName

      private final String fileName
    • data

      private final byte[] data
  • Constructor Details

    • StringResource

      public StringResource(String fileName, String text)
  • Method Details

    • getFileName

      public final String getFileName()
      Description copied from interface: Resource
      Returns a decorative "file name" that can be used for reporting errors and the like. It does not necessarily map to a file in the local file system!
      Specified by:
      getFileName in interface Resource
    • open

      public final InputStream open()
      Description copied from interface: Resource
      Opens the resource. The caller is responsible for closing the InputStream.
      Specified by:
      open in interface Resource
    • lastModified

      public final long lastModified()
      Description copied from interface: Resource
      Returns the time of the last modification, in milliseconds since 1970, or 0L if the time of the last modification cannot be determined.
      Specified by:
      lastModified in interface Resource
    • toString

      public final String toString()
      Overrides:
      toString in class Object