public class KMLFile extends java.lang.Object implements KMLDoc
KMLDoc interface for KML files located within a computer's file system.
Note: This class does not resolve references to files in KMZ archives. For example, it does not resolve references like this: ../other.kmz/file.png.
| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
kmlFile
The
File reference specified to the constructor. |
| Constructor and Description |
|---|
KMLFile(java.io.File file)
Construct a KMLFile instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getKMLStream()
Returns an
InputStream to the KML file. |
java.lang.String |
getSupportFilePath(java.lang.String path)
Returns an absolute path or URL to a file indicated by a path relative to the KML file's location.
|
java.io.InputStream |
getSupportFileStream(java.lang.String path)
Returns an
InputStream to a file indicated by a path relative to the KML file's location. |
java.io.File |
getZipFile()
Returns the
File specified to the constructor. |
protected java.io.File kmlFile
File reference specified to the constructor.public KMLFile(java.io.File file)
file - path to the KML file.java.lang.IllegalArgumentException - if the specified file is null.public java.io.InputStream getKMLStream()
throws java.io.IOException
InputStream to the KML file.getKMLStream in interface KMLDocjava.io.IOException - if an error occurs attempting to create the input stream.public java.lang.String getSupportFilePath(java.lang.String path)
KMLDocgetSupportFilePath in interface KMLDocpath - the path of the requested file.public java.io.InputStream getSupportFileStream(java.lang.String path)
throws java.io.IOException
InputStream to a file indicated by a path relative to the KML file's location.getSupportFileStream in interface KMLDocpath - the path of the requested file.java.io.IOException - if an error occurs while attempting to query or open the file.public java.io.File getZipFile()
File specified to the constructor.