Package gov.nasa.worldwind.util
Class DataConfigurationFilter
- java.lang.Object
-
- gov.nasa.worldwind.util.DataConfigurationFilter
-
- All Implemented Interfaces:
FileStoreFilter
,java.io.FileFilter
public class DataConfigurationFilter extends java.lang.Object implements java.io.FileFilter, FileStoreFilter
An implementation ofFileStoreFilter
which accepts XML configuration documents. Accepted document types are:- Layer configuration documents
- ElevationModel configuration documents
- Installed data configuration documents
- WorldWind .NET LevelSet documents
-
-
Constructor Summary
Constructors Constructor Description DataConfigurationFilter()
Creates a DataConfigurationFilter, but otherwise does nothing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(FileStore fileStore, java.lang.String fileName)
Returns true if the specified file store path can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.boolean
accept(java.io.File file)
Returns true if the specified file can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.boolean
accept(java.io.InputStream inputStream)
Returns true if the specifiedInputStream
can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.boolean
accept(java.net.URL url)
Returns true if the specifiedURL
can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.boolean
accept(org.w3c.dom.Document doc)
Returns true if the specified DOM Document should be accepted as a configuration document.boolean
accept(org.w3c.dom.Element domElement)
Returns true if the specified DOMElement
should be accepted as a configuration document.protected boolean
acceptFilePath(java.lang.String filePath)
-
-
-
Method Detail
-
accept
public boolean accept(java.io.File file)
Returns true if the specified file can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.- Specified by:
accept
in interfacejava.io.FileFilter
- Parameters:
file
- the file in question.- Returns:
- true if the file should be accepted; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the file is null.
-
accept
public boolean accept(java.net.URL url)
Returns true if the specifiedURL
can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.- Parameters:
url
- the URL in question.- Returns:
- true if the URL should be accepted; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the url is null.
-
accept
public boolean accept(java.io.InputStream inputStream)
Returns true if the specifiedInputStream
can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.- Parameters:
inputStream
- the input stream in question.- Returns:
- true if the input stream should be accepted; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the input stream is null.
-
accept
public boolean accept(FileStore fileStore, java.lang.String fileName)
Returns true if the specified file store path can be opened as an XML document, and callingaccept(org.w3c.dom.Document)
returns true.- Specified by:
accept
in interfaceFileStoreFilter
- Parameters:
fileStore
- the file store containing the named file path.fileName
- the named file path in question.- Returns:
- true if the file name should be accepted; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if either the file store or the file name are null.
-
accept
public boolean accept(org.w3c.dom.Document doc)
Returns true if the specified DOM Document should be accepted as a configuration document.- Parameters:
doc
- the Document in question.- Returns:
- true if the Document should be accepted; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
accept
public boolean accept(org.w3c.dom.Element domElement)
Returns true if the specified DOMElement
should be accepted as a configuration document.- Parameters:
domElement
- the Document in question.- Returns:
- true if the Document should be accepted; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
acceptFilePath
protected boolean acceptFilePath(java.lang.String filePath)
-
-