Class ZipResourceLoader

    • Constructor Summary

      Constructors 
      Constructor Description
      ZipResourceLoader​(java.io.File cacheDir, java.io.File zipFile, java.util.List<java.lang.String> resourcesList, java.lang.String resourcesBasedir)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void extractResources()
      Extract resources return the extracted files
      java.lang.String[] getResourceNames()
      Get the list of resources in the jar
      java.util.List<java.lang.String> listResources()  
      java.io.InputStream openResourceStreamFor​(java.lang.String path)
      Open a stream to load a resource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZipResourceLoader

        public ZipResourceLoader​(java.io.File cacheDir,
                                 java.io.File zipFile,
                                 java.util.List<java.lang.String> resourcesList,
                                 java.lang.String resourcesBasedir)
    • Method Detail

      • listResources

        public java.util.List<java.lang.String> listResources()
        Specified by:
        listResources in interface PluginResourceLoader
        Returns:
        the list of resources available
      • getResourceNames

        public java.lang.String[] getResourceNames()
        Get the list of resources in the jar
      • openResourceStreamFor

        public java.io.InputStream openResourceStreamFor​(java.lang.String path)
                                                  throws PluginException,
                                                         java.io.IOException
        Description copied from interface: PluginResourceLoader
        Open a stream to load a resource
        Specified by:
        openResourceStreamFor in interface PluginResourceLoader
        Parameters:
        path - resource path and name
        Returns:
        input stream for the resources, must be closed when finished, or null if the plugin does not support resources
        Throws:
        PluginException - if a path is requested that was not in the plugin
        java.io.IOException - if an error occurs
      • extractResources

        public void extractResources()
                              throws java.io.IOException
        Extract resources return the extracted files
        Throws:
        java.io.IOException