public class KMLFile extends 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 File |
kmlFile
The
File reference specified to the constructor. |
Constructor and Description |
---|
KMLFile(File file)
Construct a KMLFile instance.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getKMLStream()
Returns an
InputStream to the KML file. |
String |
getSupportFilePath(String path)
Returns an absolute path or URL to a file indicated by a path relative to the KML file's location.
|
InputStream |
getSupportFileStream(String path)
Returns an
InputStream to a file indicated by a path relative to the KML file's location. |
File |
getZipFile()
Returns the
File specified to the constructor. |
public KMLFile(File file)
file
- path to the KML file.IllegalArgumentException
- if the specified file is null.public InputStream getKMLStream() throws IOException
InputStream
to the KML file.getKMLStream
in interface KMLDoc
IOException
- if an error occurs attempting to create the input stream.public String getSupportFilePath(String path)
KMLDoc
getSupportFilePath
in interface KMLDoc
path
- the path of the requested file.public InputStream getSupportFileStream(String path) throws IOException
InputStream
to a file indicated by a path relative to the KML file's location.getSupportFileStream
in interface KMLDoc
path
- the path of the requested file.IOException
- if an error occurs while attempting to query or open the file.