Class FileResource

java.lang.Object
org.zeroturnaround.javarebel.support.FileResource
All Implemented Interfaces:
Resource

public class FileResource extends Object implements Resource
A file system resource.
Author:
Jevgeni Kabanov (ekabanov@zeroturnaround.com)
  • Constructor Details

    • FileResource

      public FileResource(File file)
    • FileResource

      public FileResource(URL url)
  • Method Details

    • getFile

      public File getFile()
    • getBytes

      public byte[] getBytes()
      Description copied from interface: Resource
      Returns the binary representation of the class file. Returns null if the resource is missing or cannot be read.
      Specified by:
      getBytes in interface Resource
    • lastModified

      public long lastModified()
      Description copied from interface: Resource
      Returns a millisecond representation of last modified time comparable with System.currentTimeMillis(). Returns 0L if the resource is missing or cannot be read.
      Specified by:
      lastModified in interface Resource
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toURL

      public URL toURL()
      Description copied from interface: Resource
      Returns the URL that class is loaded from.
      Specified by:
      toURL in interface Resource