Class DefaultCockpitJarCache
- java.lang.Object
-
- com.hybris.cockpitng.core.persistence.packaging.impl.DefaultCockpitJarCache
-
- All Implemented Interfaces:
CockpitJarCache,java.io.Closeable,java.lang.AutoCloseable
public class DefaultCockpitJarCache extends java.lang.Object implements CockpitJarCache
-
-
Constructor Summary
Constructors Constructor Description DefaultCockpitJarCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry(java.io.File rootPath, java.util.jar.JarFile jarFile, java.util.jar.JarEntry entry)Adds new result of searching for entry into cachevoidaddJarFile(java.io.File filePath, java.util.jar.JarFile jarFile)Adds a loaded jar file into cachevoidclose()booleancontainsEntry(java.io.File rootPath, java.lang.String resourceName)Checks whether result of searching for entry is cachedbooleancontainsJarFile(java.io.File filePath)Checks whether a jar file is cachedprotected java.lang.ObjectcreateEntryKey(java.io.File rootPath, java.lang.String resourceName)java.util.jar.JarEntrygetEntry(java.io.File rootPath, java.lang.String resourceName)Retrieves previously cached result of searching for entryjava.util.jar.JarFilegetEntryJarFile(java.io.File rootPath, java.lang.String resourceName)Retrieves jar file of previously cached result of searching for entryjava.util.jar.JarFilegetJarFile(java.io.File filePath)Retrieves a jar file from cachejava.util.jar.JarEntryremoveEntry(java.io.File rootPath, java.lang.String resourceName)Removes previously cached result of searching for entryjava.util.jar.JarFileremoveJarFile(java.io.File filePath)Removes a loaded jar file from cache
-
-
-
Method Detail
-
addJarFile
public void addJarFile(java.io.File filePath, java.util.jar.JarFile jarFile)Description copied from interface:CockpitJarCacheAdds a loaded jar file into cache- Specified by:
addJarFilein interfaceCockpitJarCache- Parameters:
filePath- full path to jar filejarFile- loaded jar file
-
removeJarFile
public java.util.jar.JarFile removeJarFile(java.io.File filePath)
Description copied from interface:CockpitJarCacheRemoves a loaded jar file from cache- Specified by:
removeJarFilein interfaceCockpitJarCache- Parameters:
filePath- full path to jar file- Returns:
- jar file removed ot
nullif there was nothing cached for provided path
-
containsJarFile
public boolean containsJarFile(java.io.File filePath)
Description copied from interface:CockpitJarCacheChecks whether a jar file is cached- Specified by:
containsJarFilein interfaceCockpitJarCache- Parameters:
filePath- full path to jar file- Returns:
trueif jar file is cached
-
getJarFile
public java.util.jar.JarFile getJarFile(java.io.File filePath)
Description copied from interface:CockpitJarCacheRetrieves a jar file from cache- Specified by:
getJarFilein interfaceCockpitJarCache- Parameters:
filePath- full path to jar file- Returns:
- jar file or
nullif jar file is not cached
-
createEntryKey
protected java.lang.Object createEntryKey(java.io.File rootPath, java.lang.String resourceName)
-
addEntry
public void addEntry(java.io.File rootPath, java.util.jar.JarFile jarFile, java.util.jar.JarEntry entry)Description copied from interface:CockpitJarCacheAdds new result of searching for entry into cache- Specified by:
addEntryin interfaceCockpitJarCache- Parameters:
rootPath- root path, in which an entry was foundjarFile- jar file in which an entry was foundentry- entry found
-
removeEntry
public java.util.jar.JarEntry removeEntry(java.io.File rootPath, java.lang.String resourceName)Description copied from interface:CockpitJarCacheRemoves previously cached result of searching for entry- Specified by:
removeEntryin interfaceCockpitJarCache- Parameters:
rootPath- root path, in which an entry was foundresourceName- name of resource searched- Returns:
- jar entry removed ot
nullif there was nothing cached for provided conditions
-
containsEntry
public boolean containsEntry(java.io.File rootPath, java.lang.String resourceName)Description copied from interface:CockpitJarCacheChecks whether result of searching for entry is cached- Specified by:
containsEntryin interfaceCockpitJarCache- Parameters:
rootPath- root path, in should have been foundresourceName- name of resource searched
-
getEntry
public java.util.jar.JarEntry getEntry(java.io.File rootPath, java.lang.String resourceName)Description copied from interface:CockpitJarCacheRetrieves previously cached result of searching for entry- Specified by:
getEntryin interfaceCockpitJarCache- Parameters:
rootPath- root path, in should have been foundresourceName- name of resource searched- Returns:
- jar entry or
nullif jar entry is not cached
-
getEntryJarFile
public java.util.jar.JarFile getEntryJarFile(java.io.File rootPath, java.lang.String resourceName)Description copied from interface:CockpitJarCacheRetrieves jar file of previously cached result of searching for entry- Specified by:
getEntryJarFilein interfaceCockpitJarCache- Parameters:
rootPath- root path, in should have been foundresourceName- name of resource searched- Returns:
- jar entry or
nullif jar entry is not cached
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-