public class CrawlableDatasetFile extends java.lang.Object implements CrawlableDataset
The constructor extends the allowed form of a CrawlableDataset path to allow file paths to be given in their native formats including Unix (/my/file), Windows (c:\my\file), and UNC file paths (\\myhost\my\file). However, the resulting CrawlableDataset path is normalized to conform to the allowed form of the CrawlableDataset path.
This is the default implementation of CrawlableDataset used by CrawlableDatasetFactory if the class name handed to the createCrawlableDataset() method is null.
Constructor and Description |
---|
CrawlableDatasetFile(java.io.File file) |
CrawlableDatasetFile(java.lang.String path,
java.lang.Object configObj)
Constructor required by CrawlableDatasetFactory.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Return true if the dataset represented by this CrawlableDataset actually
exists, null if it does not or an I/O error occurs.
|
java.lang.Object |
getConfigObject()
Return the configuration Object (can be null).
|
CrawlableDataset |
getDescendant(java.lang.String relativePath)
Return the requested descendant of this dataset.
|
java.io.File |
getFile()
Provide access to the file that this CrawlableDataset represents.
|
java.lang.String |
getName()
Returns the dataset name, i.e., the last part of the dataset path.
|
CrawlableDataset |
getParentDataset()
Returns the parent CrawlableDataset or null if this dataset has no parent.
|
java.lang.String |
getPath()
Returns the dataset path.
|
boolean |
isCollection()
Return true if the dataset is a collection dataset.
|
java.util.Date |
lastModified()
Returns the date the dataset was last modified, null if unknown.
|
long |
length()
Returns the size in bytes of the dataset, -1 if unknown.
|
java.util.List<CrawlableDataset> |
listDatasets()
Returns the list of CrawlableDatasets contained in this collection dataset.
|
java.util.List<CrawlableDataset> |
listDatasets(CrawlableDatasetFilter filter)
Returns the list of CrawlableDatasets contained in this collection dataset
that satisfy the given filter.
|
java.lang.String |
toString() |
public CrawlableDatasetFile(java.lang.String path, java.lang.Object configObj)
path
- the path of the CrawlableDataset being constructed.configObj
- the configuration object required by CrawlableDatasetFactory; it is ignored.public CrawlableDatasetFile(java.io.File file)
public java.io.File getFile()
null
if it could not be obtained.public java.lang.Object getConfigObject()
CrawlableDataset
getConfigObject
in interface CrawlableDataset
public java.lang.String getPath()
CrawlableDataset
getPath
in interface CrawlableDataset
public java.lang.String getName()
CrawlableDataset
getName
in interface CrawlableDataset
public boolean exists()
CrawlableDataset
exists
in interface CrawlableDataset
public boolean isCollection()
CrawlableDataset
isCollection
in interface CrawlableDataset
public CrawlableDataset getDescendant(java.lang.String relativePath)
CrawlableDataset
getDescendant
in interface CrawlableDataset
relativePath
- the path, relative to this dataset, of the requested dataset.public java.util.List<CrawlableDataset> listDatasets() throws java.io.IOException
CrawlableDataset
listDatasets
in interface CrawlableDataset
java.io.IOException
- if an I/O error occurs while accessing the children datasets.public java.util.List<CrawlableDataset> listDatasets(CrawlableDatasetFilter filter) throws java.io.IOException
CrawlableDataset
listDatasets
in interface CrawlableDataset
filter
- a CrawlableDataset filter (if null, accept all datasets).java.io.IOException
- if an I/O error occurs while accessing the children datasets.public CrawlableDataset getParentDataset()
CrawlableDataset
getParentDataset
in interface CrawlableDataset
public long length()
CrawlableDataset
length
in interface CrawlableDataset
public java.util.Date lastModified()
CrawlableDataset
lastModified
in interface CrawlableDataset
public java.lang.String toString()
toString
in class java.lang.Object