thredds.filesystem
Class CrawlableMFile

java.lang.Object
  extended by thredds.filesystem.CrawlableMFile
All Implemented Interfaces:
Comparable<MFile>, CrawlableDataset, MFile

@Immutable
public class CrawlableMFile
extends Object
implements MFile, CrawlableDataset

An adapter of cached MFiles to CrawlableDataset

Since:
5/22/11
Author:
caron

Method Summary
 int compareTo(MFile o)
           
 boolean exists()
          Return true if the dataset represented by this CrawlableDataset actually exists, null if it does not or an I/O error occurs.
 Object getAuxInfo()
           
 Object getConfigObject()
          Return the configuration Object (can be null).
 CrawlableDataset getDescendant(String relativePath)
          A factory method for getting a descendant of this datasets.
 long getLastModified()
           
 long getLength()
           
 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.
 String getPath()
          Returns the dataset path.
 boolean isCollection()
          Return true if the dataset is a collection dataset.
 boolean isDirectory()
           
 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.
 List<CrawlableDataset> listDatasets()
          Returns the list of CrawlableDatasets contained in this collection dataset.
 List<CrawlableDataset> listDatasets(CrawlableDatasetFilter filter)
          Returns the list of CrawlableDatasets contained in this collection dataset that satisfy the given filter.
 void setAuxInfo(Object info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface MFile

getLength

public long getLength()
Specified by:
getLength in interface MFile

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in interface MFile

compareTo

public int compareTo(MFile o)
Specified by:
compareTo in interface Comparable<MFile>
Specified by:
compareTo in interface MFile

getAuxInfo

public Object getAuxInfo()
Specified by:
getAuxInfo in interface MFile

setAuxInfo

public void setAuxInfo(Object info)
Specified by:
setAuxInfo in interface MFile

getConfigObject

public Object getConfigObject()
Description copied from interface: CrawlableDataset
Return the configuration Object (can be null).

Specified by:
getConfigObject in interface CrawlableDataset
Returns:
the configuration Object (can be null).

getPath

public String getPath()
Description copied from interface: CrawlableDataset
Returns the dataset path.

Specified by:
getPath in interface CrawlableDataset
Specified by:
getPath in interface MFile
Returns:
the dataset path.

getName

public String getName()
Description copied from interface: CrawlableDataset
Returns the dataset name, i.e., the last part of the dataset path.

Specified by:
getName in interface CrawlableDataset
Specified by:
getName in interface MFile
Returns:
the dataset name, i.e., the last part of the dataset path.

getParentDataset

public CrawlableDataset getParentDataset()
Description copied from interface: CrawlableDataset
Returns the parent CrawlableDataset or null if this dataset has no parent.

Specified by:
getParentDataset in interface CrawlableDataset
Returns:
the parent CrawlableDataset or null if this dataset has no parent.

exists

public boolean exists()
Description copied from interface: CrawlableDataset
Return true if the dataset represented by this CrawlableDataset actually exists, null if it does not or an I/O error occurs.

Specified by:
exists in interface CrawlableDataset
Returns:
true if the dataset represented by this CrawlableDataset actually exists.

isCollection

public boolean isCollection()
Description copied from interface: CrawlableDataset
Return true if the dataset is a collection dataset.

Specified by:
isCollection in interface CrawlableDataset
Returns:
true if the dataset is a collection dataset.

getDescendant

public CrawlableDataset getDescendant(String relativePath)
Description copied from interface: CrawlableDataset
A factory method for getting a descendant of this datasets.

Specified by:
getDescendant in interface CrawlableDataset
Parameters:
relativePath - the path relative to this dataset of the requested dataset.
Returns:
the requested descendant of this dataset.

listDatasets

public List<CrawlableDataset> listDatasets()
                                    throws IOException
Description copied from interface: CrawlableDataset
Returns the list of CrawlableDatasets contained in this collection dataset. The returned list will be empty if this collection dataset does not contain any children datasets. If this dataset is not a collection dataset, this method returns null.

Specified by:
listDatasets in interface CrawlableDataset
Returns:
Returns a list of the CrawlableDatasets contained in this collection dataset. The llist will be empty if no datasets are contained in this collection dataset.
Throws:
IOException - if an I/O error occurs while accessing the children datasets.

listDatasets

public List<CrawlableDataset> listDatasets(CrawlableDatasetFilter filter)
                                    throws IOException
Description copied from interface: CrawlableDataset
Returns the list of CrawlableDatasets contained in this collection dataset that satisfy the given filter. The returned list will be empty if this collection dataset does not contain any children datasets that satisfy the given filter.

Specified by:
listDatasets in interface CrawlableDataset
Parameters:
filter - a CrawlableDataset filter (if null, accept all datasets).
Returns:
Returns a list of the CrawlableDatasets contained in this collection dataset that satisfy the given filter. The list will be empty if no datasets are contained in this collection dataset.
Throws:
IOException - if an I/O error occurs while accessing the children datasets.

length

public long length()
Description copied from interface: CrawlableDataset
Returns the size in bytes of the dataset, -1 if unknown.

Specified by:
length in interface CrawlableDataset
Returns:
the size in bytes of the dataset, -1 if unknown.

lastModified

public Date lastModified()
Description copied from interface: CrawlableDataset
Returns the date the dataset was last modified, null if unknown.

Specified by:
lastModified in interface CrawlableDataset
Returns:
the date the dataset was last modified, null if unknown.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.