Search in sources :

Example 26 with StoredObject

use of org.javaswift.joss.model.StoredObject in project alluxio by Alluxio.

the class SwiftUnderFileSystem method getObjectStatus.

@Override
protected ObjectStatus getObjectStatus(String key) {
    Container container = mAccount.getContainer(mContainerName);
    StoredObject meta = container.getObject(key);
    if (meta != null && meta.exists()) {
        Date lastModifiedDate = meta.getLastModifiedAsDate();
        Long lastModifiedTime = lastModifiedDate == null ? null : lastModifiedDate.getTime();
        return new ObjectStatus(key, meta.getEtag(), meta.getContentLength(), lastModifiedTime);
    }
    return null;
}
Also used : Container(org.javaswift.joss.model.Container) StoredObject(org.javaswift.joss.model.StoredObject) Date(java.util.Date)

Aggregations

StoredObject (org.javaswift.joss.model.StoredObject)26 IOException (java.io.IOException)9 Container (org.javaswift.joss.model.Container)8 FileNotFoundException (java.io.FileNotFoundException)4 ArrayList (java.util.ArrayList)3 StocatorPath (com.ibm.stocator.fs.common.StocatorPath)2 ConfigurationParseException (com.ibm.stocator.fs.common.exception.ConfigurationParseException)2 JossAccount (com.ibm.stocator.fs.swift.auth.JossAccount)2 DataFile (edu.harvard.iq.dataverse.DataFile)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 FileStatus (org.apache.hadoop.fs.FileStatus)2 Path (org.apache.hadoop.fs.Path)2 AlreadyExistsException (org.javaswift.joss.exception.AlreadyExistsException)2 CommandException (org.javaswift.joss.exception.CommandException)2 Account (org.javaswift.joss.model.Account)2 DirectoryOrObject (org.javaswift.joss.model.DirectoryOrObject)2 Dataset (edu.harvard.iq.dataverse.Dataset)1 File (java.io.File)1 Date (java.util.Date)1 Properties (java.util.Properties)1