public class Pds3DataSourceFactory extends AbstractDataSourceFactory
Constructor and Description |
---|
Pds3DataSourceFactory() |
Modifier and Type | Method and Description |
---|---|
java.util.List<CompletionContext> |
getCompletions(CompletionContext cc,
ProgressMonitor mon)
return a list of context-sensitive completions.
|
static PDS3DataObject |
getDataObjectPds3(java.net.URL url,
java.lang.String name)
return information about how this data is stored in PDS3DataObject.
|
DataSource |
getDataSource(java.net.URI uri)
return a dataSource for the url
|
static org.w3c.dom.Document |
getDocumentWithImports(java.net.URL labelUrl)
read in the PDS label, resolving STRUCTURES which are loaded with a pointer.
|
static org.w3c.dom.Document |
getDocumentWithImports(java.net.URL labelUrl,
int depth)
read in the PDS label, resolving STRUCTURES which are loaded with a pointer.
|
protected static FilePointer |
getFileResource(java.net.URL labelFile,
ProgressMonitor mon) |
static java.net.URL |
identifyRoot(java.net.URL location)
identify the root of the volume.This was motivated by a LABL in SOFTWARE in a volume which
didn't have DATA, and I had everything mounted in /project/pds/mirror/DATA.The root will
often have DATA, DOCUMENT, and a README.txt file.
|
boolean |
reject(java.lang.String suri,
java.util.List<java.lang.String> problems,
ProgressMonitor mon)
quick check to see that an uri looks acceptable.
|
getCapability, getDescription, isFileResource, supportsDiscovery
public DataSource getDataSource(java.net.URI uri) throws java.lang.Exception
DataSourceFactory
getDataSource
in interface DataSourceFactory
getDataSource
in class AbstractDataSourceFactory
uri
- the URIjava.lang.Exception
- any exception may occur.public static PDS3DataObject getDataObjectPds3(java.net.URL url, java.lang.String name) throws java.io.IOException, PDSException, javax.xml.xpath.XPathExpressionException
url
- URL of labelname
- the object namejava.io.IOException
PDSException
javax.xml.xpath.XPathExpressionException
public boolean reject(java.lang.String suri, java.util.List<java.lang.String> problems, ProgressMonitor mon)
DataSourceFactory
reject
in interface DataSourceFactory
reject
in class AbstractDataSourceFactory
suri
- the uri.problems
- list to which problems should be added. TODO: human readable or PROB_TIMERANGE?mon
- a progress monitor, for example to monitor a file download.public static org.w3c.dom.Document getDocumentWithImports(java.net.URL labelUrl) throws java.io.IOException, PDSException
labelUrl
- the URL of the LABEL filejava.io.IOException
PDSException
public static java.net.URL identifyRoot(java.net.URL location) throws FileSystem.FileSystemOfflineException, java.net.UnknownHostException, java.io.FileNotFoundException, java.io.IOException
location
- a location within the volumeFileSystem.FileSystemOfflineException
java.net.UnknownHostException
java.io.FileNotFoundException
java.io.IOException
public static org.w3c.dom.Document getDocumentWithImports(java.net.URL labelUrl, int depth) throws java.io.IOException, PDSException
labelUrl
- the URL of the LABEL filedepth
- number of levels deep, this is limited to 4.java.io.IOException
PDSException
protected static FilePointer getFileResource(java.net.URL labelFile, ProgressMonitor mon) throws java.io.IOException, java.net.URISyntaxException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, javax.xml.xpath.XPathExpressionException, PDSException
java.io.IOException
java.net.URISyntaxException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
javax.xml.xpath.XPathExpressionException
PDSException
public java.util.List<CompletionContext> getCompletions(CompletionContext cc, ProgressMonitor mon) throws java.lang.Exception
DataSourceFactory
getCompletions
in interface DataSourceFactory
getCompletions
in class AbstractDataSourceFactory
cc
- the context for the completion.mon
- a progress monitor, for example to monitor a file download.java.lang.Exception