Class ZipMap
java.lang.Object
com.inductiveautomation.ignition.common.util.ZipMap
- All Implemented Interfaces:
- Map<String,- ZipMapFile> 
The ZipMap provides a convenient way of working with zip files by providing a 
Map that is backed by a zip
 file.
 A variety of constructors are available for creating the ZipMap. Once loaded, you can work with file objects as you would work with any normal map. To save changes, you must call writeToFile.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionZipMap()Creates an empty ZipMap.Create a ZipMap with the contents of the given zip file.ZipMap(InputStream zipFile) Create a ZipMap with the contents of the given zip file.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) protected voidentrySet()booleanisEmpty()keySet()protected byte[]Convenience method for putting a file into the ZipMap.put(String key, ZipMapFile value) Puts an entry into the ZipMap.Convenience method for putting a file into the ZipMap.voidputAll(Map<? extends String, ? extends ZipMapFile> t) intsize()values()voidwriteToFile(File outputFile) Write the contents of this ZipMap to a zip file using the supplied File.voidwriteToFile(OutputStream outputStream) Write the contents of this ZipMap to a zip file using the supplied OutputStream.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Constructor Details- 
ZipMappublic ZipMap()Creates an empty ZipMap. Changes need to be explicitly written usingwriteToFile(File)orwriteToFile(OutputStream).
- 
ZipMapCreate a ZipMap with the contents of the given zip file. Changes need to be explicitly written usingwriteToFile(File)orwriteToFile(OutputStream).- Throws:
- IOException
 
- 
ZipMapCreate a ZipMap with the contents of the given zip file. Changes need to be explicitly written usingwriteToFile(File)orwriteToFile(OutputStream).- Throws:
- IOException
 
 
- 
- 
Method Details- 
loadEntry
- 
ensureAllLoaded- Throws:
- IOException
 
- 
writeToFileWrite the contents of this ZipMap to a zip file using the supplied File.- Parameters:
- outputFile- the file to write to
- Throws:
- IOException- on failure to write
 
- 
writeToFileWrite the contents of this ZipMap to a zip file using the supplied OutputStream.- Throws:
- IOException
 
- 
clearpublic void clear()- Specified by:
- clearin interface- Map<String,- ZipMapFile> 
 
- 
containsKey- Specified by:
- containsKeyin interface- Map<String,- ZipMapFile> 
 
- 
containsValue- Specified by:
- containsValuein interface- Map<String,- ZipMapFile> 
 
- 
entrySet- Specified by:
- entrySetin interface- Map<String,- ZipMapFile> 
 
- 
get- Specified by:
- getin interface- Map<String,- ZipMapFile> 
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- Map<String,- ZipMapFile> 
 
- 
keySet- Specified by:
- keySetin interface- Map<String,- ZipMapFile> 
 
- 
putPuts an entry into the ZipMap. Directory names should end with a "/".- Specified by:
- putin interface- Map<String,- ZipMapFile> 
 
- 
putConvenience method for putting a file into the ZipMap.- Parameters:
- key- Name of the file. Example: "hello.txt" or "dir/world.txt".
- value- The file itself. A ZipMapFile will be created from this File.
- Returns:
- The ZipMapFile added to the ZipMap.
 
- 
putConvenience method for putting a file into the ZipMap.- Parameters:
- key- Name of the file. Example: "hello.txt" or "dir/world.txt".
- value- The byte[] itself. A ZipMapFile will be created from this byte[] with directory=false.
- Returns:
- The ZipMapFile added to the ZipMap.
 
- 
putAll- Specified by:
- putAllin interface- Map<String,- ZipMapFile> 
 
- 
remove- Specified by:
- removein interface- Map<String,- ZipMapFile> 
 
- 
sizepublic int size()- Specified by:
- sizein interface- Map<String,- ZipMapFile> 
 
- 
values- Specified by:
- valuesin interface- Map<String,- ZipMapFile> 
 
 
-