Package thredds.crawlabledataset.s3
Class CrawlableDatasetAmazonS3
- java.lang.Object
-
- thredds.crawlabledataset.CrawlableDatasetFile
-
- thredds.crawlabledataset.s3.CrawlableDatasetAmazonS3
-
- All Implemented Interfaces:
CrawlableDataset
public class CrawlableDatasetAmazonS3 extends CrawlableDatasetFile
CrawlableDataset implementation that allows THREDDS to interact with datasets stored on Amazon S3.- Since:
- 2015/08/23
-
-
Constructor Summary
Constructors Constructor Description CrawlableDatasetAmazonS3(String path)CrawlableDatasetAmazonS3(String path, Object configObject)CrawlableDatasetAmazonS3(S3URI s3uri)CrawlableDatasetAmazonS3(S3URI s3uri, Object configObject)CrawlableDatasetAmazonS3(S3URI s3uri, Object configObject, ThreddsS3Client threddsS3Client)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearCache()booleanequals(Object other)booleanexists()Return true if the dataset represented by this CrawlableDataset actually exists, null if it does not or an I/O error occurs.CrawlableDatasetgetDescendant(String relativePath)Return the requested descendant of this dataset.FilegetFile()Provide access to the file that this CrawlableDataset represents.StringgetName()Returns the dataset name, i.e., the last part of the dataset path.CrawlableDatasetgetParentDataset()Returns the parent CrawlableDataset or null if this dataset has no parent.StringgetPath()Returns the dataset path.S3URIgetS3URI()ThreddsS3ClientgetThreddsS3Client()inthashCode()booleanisCollection()Return true if the dataset is a collection dataset.DatelastModified()Returns the date that the dataset was last modified.longlength()Returns the size of the dataset, in bytes.List<CrawlableDataset>listDatasets()Returns the list of CrawlableDatasets contained in this collection dataset.static voidsetDefaultThreddsS3Client(ThreddsS3Client threddsS3Client)StringtoString()-
Methods inherited from class thredds.crawlabledataset.CrawlableDatasetFile
getConfigObject, listDatasets
-
-
-
-
Constructor Detail
-
CrawlableDatasetAmazonS3
public CrawlableDatasetAmazonS3(String path)
-
CrawlableDatasetAmazonS3
public CrawlableDatasetAmazonS3(S3URI s3uri)
-
CrawlableDatasetAmazonS3
public CrawlableDatasetAmazonS3(S3URI s3uri, Object configObject, ThreddsS3Client threddsS3Client)
-
-
Method Detail
-
setDefaultThreddsS3Client
public static void setDefaultThreddsS3Client(ThreddsS3Client threddsS3Client)
-
clearCache
public static void clearCache()
-
getS3URI
public S3URI getS3URI()
-
getThreddsS3Client
public ThreddsS3Client getThreddsS3Client()
-
getFile
public File getFile()
Description copied from class:CrawlableDatasetFileProvide access to the file that this CrawlableDataset represents.- Overrides:
getFilein classCrawlableDatasetFile- Returns:
- the file that this CrawlableDataset represents or
nullif it could not be obtained.
-
getPath
public String getPath()
Description copied from interface:CrawlableDatasetReturns the dataset path.- Specified by:
getPathin interfaceCrawlableDataset- Overrides:
getPathin classCrawlableDatasetFile- Returns:
- the dataset path.
-
getName
public String getName()
Description copied from interface:CrawlableDatasetReturns the dataset name, i.e., the last part of the dataset path.- Specified by:
getNamein interfaceCrawlableDataset- Overrides:
getNamein classCrawlableDatasetFile- Returns:
- the dataset name, i.e., the last part of the dataset path.
-
getParentDataset
public CrawlableDataset getParentDataset()
Description copied from interface:CrawlableDatasetReturns the parent CrawlableDataset or null if this dataset has no parent.- Specified by:
getParentDatasetin interfaceCrawlableDataset- Overrides:
getParentDatasetin classCrawlableDatasetFile- Returns:
- the parent CrawlableDataset or null if this dataset has no parent.
-
getDescendant
public CrawlableDataset getDescendant(String relativePath)
Description copied from interface:CrawlableDatasetReturn the requested descendant of this dataset.- Specified by:
getDescendantin interfaceCrawlableDataset- Overrides:
getDescendantin classCrawlableDatasetFile- Parameters:
relativePath- the path, relative to this dataset, of the requested dataset.- Returns:
- the requested descendant of this dataset.
-
exists
public boolean exists()
Description copied from interface:CrawlableDatasetReturn true if the dataset represented by this CrawlableDataset actually exists, null if it does not or an I/O error occurs.- Specified by:
existsin interfaceCrawlableDataset- Overrides:
existsin classCrawlableDatasetFile- Returns:
- true if the dataset represented by this CrawlableDataset actually exists.
-
isCollection
public boolean isCollection()
Description copied from interface:CrawlableDatasetReturn true if the dataset is a collection dataset.- Specified by:
isCollectionin interfaceCrawlableDataset- Overrides:
isCollectionin classCrawlableDatasetFile- Returns:
- true if the dataset is a collection dataset.
-
listDatasets
public List<CrawlableDataset> listDatasets() throws IOException
Description copied from interface:CrawlableDatasetReturns 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:
listDatasetsin interfaceCrawlableDataset- Overrides:
listDatasetsin classCrawlableDatasetFile- 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.
-
length
public long length()
Returns the size of the dataset, in bytes. Will be zero if this dataset is a collection or non-existent.- Specified by:
lengthin interfaceCrawlableDataset- Overrides:
lengthin classCrawlableDatasetFile- Returns:
- the size of the dataset
-
lastModified
public Date lastModified()
Returns the date that the dataset was last modified. Will be null if the dataset is a collection or non-existent.- Specified by:
lastModifiedin interfaceCrawlableDataset- Overrides:
lastModifiedin classCrawlableDatasetFile- Returns:
- the date that the dataset was last modified
-
toString
public String toString()
- Overrides:
toStringin classCrawlableDatasetFile
-
-