Class ZipMap
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.util.ZipMap
 
- 
- All Implemented Interfaces:
- java.util.Map<java.lang.String,ZipMapFile>
 
 public class ZipMap extends java.lang.Object implements java.util.Map<java.lang.String,ZipMapFile> The ZipMap provides a convenient way of working with zip files by providing aMapthat 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 Modifier and Type Class Description protected classZipMap.ZipMapFileImpl
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)protected voidensureAllLoaded()java.util.Set<java.util.Map.Entry<java.lang.String,ZipMapFile>>entrySet()ZipMapFileget(java.lang.Object key)booleanisEmpty()java.util.Set<java.lang.String>keySet()protected byte[]loadEntry(java.util.zip.ZipEntry e)ZipMapFileput(java.lang.String key, byte[] value)Convenience method for putting a file into the ZipMap.ZipMapFileput(java.lang.String key, ZipMapFile value)Puts an entry into the ZipMap.ZipMapFileput(java.lang.String key, java.io.File value)Convenience method for putting a file into the ZipMap.voidputAll(java.util.Map<? extends java.lang.String,? extends ZipMapFile> t)ZipMapFileremove(java.lang.Object key)intsize()java.util.Collection<ZipMapFile>values()voidwriteToFile(java.io.File outputFile)Write the contents of this ZipMap to a zip file using the supplied File.voidwriteToFile(java.io.OutputStream outputStream)Write the contents of this ZipMap to a zip file using the supplied OutputStream.
 
- 
- 
- 
Constructor Detail- 
ZipMappublic ZipMap() Creates an empty ZipMap. Changes need to be explicitly written usingwriteToFile(File)orwriteToFile(OutputStream).
 - 
ZipMappublic ZipMap(java.io.File zipFile) throws java.io.IOExceptionCreate a ZipMap with the contents of the given zip file. Changes need to be explicitly written usingwriteToFile(File)orwriteToFile(OutputStream).- Throws:
- java.io.IOException
 
 - 
ZipMappublic ZipMap(java.io.InputStream zipFile) throws java.io.IOExceptionCreate a ZipMap with the contents of the given zip file. Changes need to be explicitly written usingwriteToFile(File)orwriteToFile(OutputStream).- Throws:
- java.io.IOException
 
 
- 
 - 
Method Detail- 
loadEntryprotected byte[] loadEntry(java.util.zip.ZipEntry e) 
 - 
ensureAllLoadedprotected void ensureAllLoaded() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
writeToFilepublic void writeToFile(java.io.File outputFile) throws java.io.IOExceptionWrite the contents of this ZipMap to a zip file using the supplied File.- Parameters:
- outputFile- the file to write to
- Throws:
- java.io.IOException- on failure to write
 
 - 
writeToFilepublic void writeToFile(java.io.OutputStream outputStream) throws java.io.IOExceptionWrite the contents of this ZipMap to a zip file using the supplied OutputStream.- Throws:
- java.io.IOException
 
 - 
clearpublic void clear() - Specified by:
- clearin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
containsKeypublic boolean containsKey(java.lang.Object key) - Specified by:
- containsKeyin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
containsValuepublic boolean containsValue(java.lang.Object value) - Specified by:
- containsValuein interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
entrySet@Nonnull public java.util.Set<java.util.Map.Entry<java.lang.String,ZipMapFile>> entrySet() - Specified by:
- entrySetin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
getpublic ZipMapFile get(java.lang.Object key) - Specified by:
- getin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
keySet@Nonnull public java.util.Set<java.lang.String> keySet() - Specified by:
- keySetin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
putpublic ZipMapFile put(java.lang.String key, ZipMapFile value) Puts an entry into the ZipMap. Directory names should end with a "/".- Specified by:
- putin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
putpublic ZipMapFile put(java.lang.String key, java.io.File value) Convenience 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.
 
 - 
putpublic ZipMapFile put(java.lang.String key, byte[] value) Convenience 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.
 
 - 
putAllpublic void putAll(java.util.Map<? extends java.lang.String,? extends ZipMapFile> t) - Specified by:
- putAllin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
removepublic ZipMapFile remove(java.lang.Object key) - Specified by:
- removein interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
sizepublic int size() - Specified by:
- sizein interface- java.util.Map<java.lang.String,ZipMapFile>
 
 - 
values@Nonnull public java.util.Collection<ZipMapFile> values() - Specified by:
- valuesin interface- java.util.Map<java.lang.String,ZipMapFile>
 
 
- 
 
-