Class URLResource

  • All Implemented Interfaces:
    Resource

    public class URLResource
    extends Object
    implements Resource
    A URL based resource.
    Author:
    Jevgeni Kabanov (ekabanov@zeroturnaround.com), Rein Raudjärv
    • Constructor Detail

      • URLResource

        public URLResource​(URL url)
    • Method Detail

      • toURL

        public URL toURL()
        Description copied from interface: Resource
        Returns the URL that class is loaded from.
        Specified by:
        toURL in interface Resource
      • 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