Interface CockpitJarCache

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    DefaultCockpitJarCache

    public interface CockpitJarCache
    extends java.io.Closeable
    Cache of loaded jar files and entries found in them
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addEntry​(java.io.File rootPath, java.util.jar.JarFile jarFile, java.util.jar.JarEntry entry)
      Adds new result of searching for entry into cache
      void addJarFile​(java.io.File filePath, java.util.jar.JarFile jarFile)
      Adds a loaded jar file into cache
      boolean containsEntry​(java.io.File rootPath, java.lang.String resourceName)
      Checks whether result of searching for entry is cached
      boolean containsJarFile​(java.io.File filePath)
      Checks whether a jar file is cached
      java.util.jar.JarEntry getEntry​(java.io.File rootPath, java.lang.String resourceName)
      Retrieves previously cached result of searching for entry
      java.util.jar.JarFile getEntryJarFile​(java.io.File rootPath, java.lang.String resourceName)
      Retrieves jar file of previously cached result of searching for entry
      java.util.jar.JarFile getJarFile​(java.io.File filePath)
      Retrieves a jar file from cache
      java.util.jar.JarEntry removeEntry​(java.io.File rootPath, java.lang.String resourceName)
      Removes previously cached result of searching for entry
      java.util.jar.JarFile removeJarFile​(java.io.File filePath)
      Removes a loaded jar file from cache
      • Methods inherited from interface java.io.Closeable

        close
    • Method Detail

      • addJarFile

        void addJarFile​(java.io.File filePath,
                        java.util.jar.JarFile jarFile)
        Adds a loaded jar file into cache
        Parameters:
        filePath - full path to jar file
        jarFile - loaded jar file
      • removeJarFile

        java.util.jar.JarFile removeJarFile​(java.io.File filePath)
        Removes a loaded jar file from cache
        Parameters:
        filePath - full path to jar file
        Returns:
        jar file removed ot null if there was nothing cached for provided path
      • containsJarFile

        boolean containsJarFile​(java.io.File filePath)
        Checks whether a jar file is cached
        Parameters:
        filePath - full path to jar file
        Returns:
        true if jar file is cached
      • getJarFile

        java.util.jar.JarFile getJarFile​(java.io.File filePath)
        Retrieves a jar file from cache
        Parameters:
        filePath - full path to jar file
        Returns:
        jar file or null if jar file is not cached
      • addEntry

        void addEntry​(java.io.File rootPath,
                      java.util.jar.JarFile jarFile,
                      java.util.jar.JarEntry entry)
        Adds new result of searching for entry into cache
        Parameters:
        rootPath - root path, in which an entry was found
        jarFile - jar file in which an entry was found
        entry - entry found
      • removeEntry

        java.util.jar.JarEntry removeEntry​(java.io.File rootPath,
                                           java.lang.String resourceName)
        Removes previously cached result of searching for entry
        Parameters:
        rootPath - root path, in which an entry was found
        resourceName - name of resource searched
        Returns:
        jar entry removed ot null if there was nothing cached for provided conditions
      • containsEntry

        boolean containsEntry​(java.io.File rootPath,
                              java.lang.String resourceName)
        Checks whether result of searching for entry is cached
        Parameters:
        rootPath - root path, in should have been found
        resourceName - name of resource searched
      • getEntry

        java.util.jar.JarEntry getEntry​(java.io.File rootPath,
                                        java.lang.String resourceName)
        Retrieves previously cached result of searching for entry
        Parameters:
        rootPath - root path, in should have been found
        resourceName - name of resource searched
        Returns:
        jar entry or null if jar entry is not cached
      • getEntryJarFile

        java.util.jar.JarFile getEntryJarFile​(java.io.File rootPath,
                                              java.lang.String resourceName)
        Retrieves jar file of previously cached result of searching for entry
        Parameters:
        rootPath - root path, in should have been found
        resourceName - name of resource searched
        Returns:
        jar entry or null if jar entry is not cached