Class WSJarResourceFile

java.lang.Object
com.iizix.jetty.WSJarResourceFile

public class WSJarResourceFile extends Object
The Resource for Jetty that refers to a JarEntry of file type inside an XJar or MemoryJar.
  • Constructor Details

    • WSJarResourceFile

      public WSJarResourceFile(IJarFile jarFile, JarEntry jarEntry, long lastModified, URL url)
      Constructs the resource for the Jar file in question and the file entry.
      Parameters:
      jarFile - The Jar file.
      jarEntry - The Jar Entry.
      lastModified - Last modified time in milliseconds since Epoch.
      url - The URL.
      Throws:
      IllegalArgumentException - If jarEntry is not of File type, i.e. is a directory.
      NullPointerException - If either jarFile or jarEntry is null.
  • Method Details

    • getData

      public byte[] getData()
      Gets the data of the resource.
      Returns:
      The data (cloned).
    • getURI

      public URI getURI()
      Gets the URI of the resource.
      Returns:
      The URI.
    • toString

      public String toString()
      Constructs a string representation of this object.
      Overrides:
      toString in class Object
      Returns:
      A string as "className[jar=fileName,entry=entryName]".
    • newResource

      public Resource newResource()
      Creates a new resource from this in-memory file resource.
      Returns:
      The new resource.