Class JarResource

    • Field Detail

      • _jarConnection

        protected java.net.JarURLConnection _jarConnection
    • Constructor Detail

      • JarResource

        protected JarResource​(java.net.URL url)
      • JarResource

        protected JarResource​(java.net.URL url,
                              boolean useCaches)
    • Method Detail

      • close

        public void close()
        Description copied from class: URLResource
        Release any resources held by the resource.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class URLResource
      • newConnection

        protected void newConnection()
                              throws java.io.IOException
        Throws:
        java.io.IOException - Sub-classes of JarResource may throw an IOException (or subclass)
      • exists

        public boolean exists()
        Returns true if the represented resource exists.
        Overrides:
        exists in class URLResource
        Returns:
        true if the represented resource exists.
      • getFile

        public java.io.File getFile()
                             throws java.io.IOException
        Description copied from class: URLResource
        Returns an File representing the given resource or NULL if this is not possible.
        Overrides:
        getFile in class URLResource
        Returns:
        an File representing the given resource or NULL if this is not possible.
        Throws:
        java.io.IOException - if unable to get the resource due to permissions
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from class: URLResource
        Returns an input stream to the resource. The underlying url connection will be nulled out to prevent re-use.
        Overrides:
        getInputStream in class URLResource
        Returns:
        an input stream to the resource
        Throws:
        java.io.IOException - if unable to open the input stream
      • copyTo

        public void copyTo​(java.io.File directory)
                    throws java.io.IOException
        Description copied from class: Resource
        Copy the Resource to the new destination file.

        Will not replace existing destination file.

        Overrides:
        copyTo in class Resource
        Parameters:
        directory - the destination file to create
        Throws:
        java.io.IOException - if unable to copy the resource
      • newJarResource

        public static Resource newJarResource​(Resource resource)
                                       throws java.io.IOException
        Throws:
        java.io.IOException