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 void
clearCache()
boolean
equals(Object other)
boolean
exists()
Return true if the dataset represented by this CrawlableDataset actually exists, null if it does not or an I/O error occurs.CrawlableDataset
getDescendant(String relativePath)
Return the requested descendant of this dataset.File
getFile()
Provide access to the file that this CrawlableDataset represents.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.S3URI
getS3URI()
ThreddsS3Client
getThreddsS3Client()
int
hashCode()
boolean
isCollection()
Return true if the dataset is a collection dataset.Date
lastModified()
Returns the date that the dataset was last modified.long
length()
Returns the size of the dataset, in bytes.List<CrawlableDataset>
listDatasets()
Returns the list of CrawlableDatasets contained in this collection dataset.static void
setDefaultThreddsS3Client(ThreddsS3Client threddsS3Client)
String
toString()
-
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:CrawlableDatasetFile
Provide access to the file that this CrawlableDataset represents.- Overrides:
getFile
in classCrawlableDatasetFile
- Returns:
- the file that this CrawlableDataset represents or
null
if it could not be obtained.
-
getPath
public String getPath()
Description copied from interface:CrawlableDataset
Returns the dataset path.- Specified by:
getPath
in interfaceCrawlableDataset
- Overrides:
getPath
in classCrawlableDatasetFile
- 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 interfaceCrawlableDataset
- Overrides:
getName
in classCrawlableDatasetFile
- 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 interfaceCrawlableDataset
- Overrides:
getParentDataset
in classCrawlableDatasetFile
- Returns:
- the parent CrawlableDataset or null if this dataset has no parent.
-
getDescendant
public CrawlableDataset getDescendant(String relativePath)
Description copied from interface:CrawlableDataset
Return the requested descendant of this dataset.- Specified by:
getDescendant
in interfaceCrawlableDataset
- Overrides:
getDescendant
in 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: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 interfaceCrawlableDataset
- Overrides:
exists
in classCrawlableDatasetFile
- 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 interfaceCrawlableDataset
- Overrides:
isCollection
in classCrawlableDatasetFile
- Returns:
- true if the dataset is a collection 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 interfaceCrawlableDataset
- Overrides:
listDatasets
in 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:
length
in interfaceCrawlableDataset
- Overrides:
length
in 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:
lastModified
in interfaceCrawlableDataset
- Overrides:
lastModified
in classCrawlableDatasetFile
- Returns:
- the date that the dataset was last modified
-
toString
public String toString()
- Overrides:
toString
in classCrawlableDatasetFile
-
-