|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.ogc.kml.io.KMZFile
public class KMZFile
Implements the KMLDoc interface for KMZ files located within a computer's file system.
| Field Summary | |
|---|---|
protected Map<String,File> |
files
A mapping of the files in the KMZ file to their location in the temporary directory. |
protected File |
tempDir
The directory to hold files copied from the KMZ file. |
protected ZipFile |
zipFile
The ZipFile reference specified to the constructor. |
| Constructor Summary | |
|---|---|
KMZFile(File file)
Construct a KMZFile instance. |
|
| Method Summary | |
|---|---|
protected String |
copyEntryToTempDir(ZipEntry entry)
Copies a zip entry to a temporary file. |
InputStream |
getKMLStream()
Returns an InputStream to the first KML file in the KMZ file. |
String |
getSupportFilePath(String path)
Returns an absolute path to a specified file within the KMZ file. |
InputStream |
getSupportFileStream(String path)
Returns an InputStream to a specified file within the KMZ file. |
ZipFile |
getZipFile()
Returns the file file specified to the constructor as a ZipFile. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,File> files
protected File tempDir
protected ZipFile zipFile
ZipFile reference specified to the constructor.
| Constructor Detail |
|---|
public KMZFile(File file)
throws IOException
file - path to the KMZ file.
IOException - if an error occurs while attempting to query or open the file.
IllegalArgumentException - if the specified file is null.
ZipException - if a Zip error occurs.| Method Detail |
|---|
protected String copyEntryToTempDir(ZipEntry entry)
throws IOException
entry - the entry to copy.
IOException - if an error occurs during the copy.
public InputStream getKMLStream()
throws IOException
InputStream to the first KML file in the KMZ file.
getKMLStream in interface KMLDocIOException - if an error occurs while attempting to create or open the input stream.
public String getSupportFilePath(String path)
throws IOException
getSupportFilePath in interface KMLDocpath - the path of the requested file.
IllegalArgumentException - if the path is null.
IOException - if an error occurs while attempting to create a temporary file.
public InputStream getSupportFileStream(String path)
throws IOException
InputStream to a specified file within the KMZ file. The file's path is resolved relative to
the internal root of the KMZ file.
Note: This class does not yet resolve references to files in other KMZ archives. For example, it does not resolve
references like this: ../other.kmz/file.png.
getSupportFileStream in interface KMLDocpath - the path of the requested file.
IllegalArgumentException - if the path is null.
IOException - if an error occurs while attempting to create or open the input stream.public ZipFile getZipFile()
ZipFile.
ZipFile.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||