Search in sources :

Example 6 with Multipart

use of com.pspace.ifs.ksan.gw.object.multipart.Multipart in project ksan by infinistor.

the class MongoDataRepository method getMulipartUpload.

@Override
public Multipart getMulipartUpload(String uploadId) throws SQLException {
    MongoCollection<Document> multip;
    Multipart mpart = null;
    multip = getMultiPartUploadCollection();
    if (multip == null)
        return null;
    FindIterable fit = multip.find(Filters.eq(UPLOADID, uploadId));
    Iterator it = fit.iterator();
    if ((it.hasNext())) {
        Document doc = (Document) it.next();
        mpart = new Multipart(doc.getString(BUCKETNAME), doc.getString(OBJKEY), uploadId);
        mpart.setLastModified((Date) doc.getDate(LASTMODIFIED));
        mpart.setAcl(doc.getString(ACL));
        mpart.setMeta(doc.getString(META));
    }
    return mpart;
}
Also used : Multipart(com.pspace.ifs.ksan.gw.object.multipart.Multipart) Iterator(java.util.Iterator) FindIterable(com.mongodb.client.FindIterable) Document(org.bson.Document)

Aggregations

Multipart (com.pspace.ifs.ksan.gw.object.multipart.Multipart)6 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 GWException (com.pspace.ifs.ksan.gw.exception.GWException)3 S3Bucket (com.pspace.ifs.ksan.gw.identity.S3Bucket)3 S3Metadata (com.pspace.ifs.ksan.gw.identity.S3Metadata)3 Part (com.pspace.ifs.ksan.gw.object.multipart.Part)3 ObjMultipart (com.pspace.ifs.ksan.objmanager.ObjMultipart)3 UnknownHostException (java.net.UnknownHostException)3 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)2 FindIterable (com.mongodb.client.FindIterable)2 S3Object (com.pspace.ifs.ksan.gw.object.S3Object)2 S3ObjectOperation (com.pspace.ifs.ksan.gw.object.S3ObjectOperation)2 Metadata (com.pspace.ifs.ksan.objmanager.Metadata)2 IOException (java.io.IOException)2 Writer (java.io.Writer)2 Iterator (java.util.Iterator)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 XMLOutputFactory (javax.xml.stream.XMLOutputFactory)2