Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2013-2015 Dell, Inc ==================================================================== Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ====================================================================
 
 
 package org.dasein.cloud.azure.storage;
 
 import java.io.File;
 
 
 import  javax.annotation.Nonnull;
 import  javax.annotation.Nullable;
 
 public class BlobStore extends AbstractBlobStoreSupport<Azure> {
     static private final Logger logger = Azure.getLogger(BlobStore.class);
 
     static public final int                                       MAX_BUCKETS     = 100;
     static public final int                                       MAX_OBJECTS     = -1;
     static public final Storage<org.dasein.util.uom.storage.ByteMAX_OBJECT_SIZE = new Storage<org.dasein.util.uom.storage.Byte>(5000000000L, .);
 
     private Azure provider = null;
 
     public BlobStore(Azure provider) {
         super(provider);
         this. = provider;
     }
 
     @Override
     public boolean allowsNestedBuckets() throws CloudExceptionInternalException {
         return false;
     }
 
     @Override
     public boolean allowsRootObjects() throws CloudExceptionInternalException {
         return false;
     }
 
     @Override
     public boolean allowsPublicSharing() throws CloudExceptionInternalException {
         return false;
     }
 
     private void commitBlocks(@Nonnull String bucket, @Nonnull String object, @Nonnull Collection<StringblockIdsthrows InternalExceptionCloudException {
         String resource = bucket + "/" + object ;
 
         TreeMap <StringStringheaders = new TreeMap <StringString>();
         TreeMap <StringStringqueries = new TreeMap <StringString>();
 
         queries.put("comp""blocklist");
 
        //Create post body
        Document doc = AzureStorageMethod.createDoc();
        Element blockList = doc.createElement("BlockList");
        for(String idblockIds){
            Element uncommitted = doc.createElement("Uncommitted");
            uncommitted.setTextContent(id);
            blockList.appendChild(uncommitted);
        }
        doc.appendChild(blockList);
        AzureStorageMethod method = new AzureStorageMethod();
        method.invoke(.resourcequeries, AzureStorageMethod.convertDomToString(doc), headerstrue);
    }
    public void copyFile(@Nullable String sourceBucket, @Nonnull String sourceObject, @Nullable String targetBucket, @Nonnull String targetObjectthrows InternalExceptionCloudException {
        .debug("ENTER - " + BlobStore.class.getName() + ".copyFile(" + sourceBucket + "," + sourceObject + "," + targetBucket + "," + targetObject + ")");
        try {
            ProviderContext ctx = .getContext();
            ifctx == null ) {
                throw new AzureConfigException("No context was set for this request");
            }
            String regionId = ctx.getRegionId();
            ifregionId == null ) {
                throw new AzureConfigException("No region ID was specified for this request");
            }
            HashMap<String,Stringheaders = new HashMap<String,String>();
            String storageService = .getStorageService();
            ifstorageService == null || storageService.isEmpty()) {
                throw new CloudException("Unable to find storage service in the current region: " + ctx.getRegionId());
            }
            headers.put("x-ms-copy-source""/" + storageService + "/" + sourceBucket + "/" + sourceObject);
            TreeMap <StringStringqueryParams = new TreeMap <StringString>();
            AzureStorageMethod method = new AzureStorageMethod();
            method.invoke(.targetBucket + "/" + targetObjectqueryParamsnullheaderstrue);
            long timeout = System.currentTimeMillis() + (. * 30L);
            whiletimeout > System.currentTimeMillis() ) {
                try {
                    Blob blob = getObject(targetBuckettargetObject);
                    ifblob != null ) {
                        return;
                    }
                }
                catchThrowable ignore ) {
                    // ignore
                }
                try { Thread.sleep(60000L); }
                catchInterruptedException ignore ) { }
            }
        }
        finally {
            .debug("EXIT - " + BlobStore.class.getName() + ".copyFile()");
        }
    }
    @Override
    public @Nonnull Blob createBucket(@Nonnull String bucketNameboolean findFreeNamethrows InternalExceptionCloudException {
        .debug("ENTER - " + BlobStore.class.getName() + ".createBucket(" + bucketName + "," + findFreeName);
        if (bucketName.contains("/")) {
            throw new OperationNotSupportedException("Nested buckets not supported");
        }
        try {
            ProviderContext ctx = .getContext();
            ifctx == null ) {
                throw new AzureConfigException("No context was set for this request");
            }
            String regionId = ctx.getRegionId();
            ifregionId == null ) {
                throw new AzureConfigException("No region ID was specified for this request");
            }
            TreeMap <StringStringqueries = new TreeMap <StringString>();
            AzureStorageMethod method = new AzureStorageMethod();
            queries.put("restype""container");
            iffindFreeName ) {
                String name = bucketName;
                int idx = 1;
                whileexists(name) ) {
                    name = bucketName + "-" + (idx++);
                }
                bucketName = name;
            }
            method.invoke(.bucketNamequeriesnullnulltrue);
            Blob bucket = getBucket(bucketName);
            ifbucket == null ) {
                .error("Unable to find newly created bucket: " + bucket);
                throw new CloudException("Unable to find newly created bucket: " + bucket);
            }
            return bucket;
        }
        finally {
            .debug("exit - createRootContainer(String)");
        }
    }
    @Override
    public boolean exists(@Nonnull String bucketNamethrows InternalExceptionCloudException {
        TreeMap <StringStringqueries = new TreeMap <StringString>();
        AzureStorageMethod method = new AzureStorageMethod();
        queries.put("comp""list");
        Document doc = method.getAsDoc(.""queriesnullnulltrue);
        NodeList matches = doc.getElementsByTagName("Container");
        ifmatches != null ){
            forint i=0; i<matches.getLength(); i++ ) {
                Node bucket = matches.item(i);
                ifbucket.hasChildNodes() ) {
                    NodeList attributes = bucket.getChildNodes();
                    forint j=0; j<attributes.getLength(); j++ ) {
                        Node attr = attributes.item(j);
                        ifattr.getNodeName().equalsIgnoreCase("name") && attr.hasChildNodes() && attr.getFirstChild().getNodeValue().trim().equals(bucketName) ) {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
    private @Nonnull Collection<StringgetBlocks(@Nonnull String bucket, @Nonnull String object, @Nonnull String blocklistType, @Nonnull String blockTypeTagthrows  InternalExceptionCloudException{
        TreeMap<StringStringqueries = new TreeMap <StringString>();
        ArrayList<StringidList = new ArrayList<String>();
        String resource = bucket + "/" + object;
        queries.put("comp""blocklist");
        // committed, uncommitted, or all ; default committed
        queries.put("blocklisttype"blocklistType);
        try {
            AzureStorageMethod method = new AzureStorageMethod();
            Document doc = method.getAsDoc(.,
                    resourcequeriesnullnulltrue);
            NodeList matches = doc.getElementsByTagName(blockTypeTag);
            if(matches != null){
                Node block = matches.item(0);
                NodeList blockAttributes = block.getChildNodes();
                forint i=0; i<blockAttributes.getLength(); i++ ) {
                    Node node = blockAttributes.item(i);
                    if(node.getNodeType() == .continue;
                    if(!node.getNodeName().equals("Block")) continue;
                    NodeList attributes = node.getChildNodes();
                    forint j=0; j<attributes.getLength(); j++ ) {
                        Node attribute = attributes.item(j);
                        ifattribute.getNodeName().equalsIgnoreCase("Name") ) {
                            idList.add(attribute.getFirstChild().getNodeValue());
                        }
                    }
                }
            }
        } catch (AzureConfigException e) {
            e.printStackTrace();
        } catch (InternalException e) {
            e.printStackTrace();
        }
        return idList;
    }
    @Override
    public Blob getBucket(@Nonnull String bucketNamethrows InternalExceptionCloudException {
        forBlob blob : list(null) ) {
            ifblob.isContainer() ) {
                String name = blob.getBucketName();
                ifname != null && name.equals(bucketName) ) {
                    return blob;
                }
            }
        }
        return null;
    }
    @Override
    public Blob getObject(@Nullable String bucketName, @Nonnull String objectNamethrows InternalExceptionCloudException {
        ifbucketName == null ) {
            return null;
        }
        forBlob blob : list(bucketName) ) {
            String name = blob.getObjectName();
            ifname != null && name.equals(objectName) ) {
                return blob;
            }
        }
        return null;
    }
    @Nullable
    @Override
    public String getSignedObjectUrl(@Nonnull String bucket, @Nonnull String object, @Nonnull String expiresEpochInSecondsthrows InternalExceptionCloudException {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
    @Override
    public @Nullable Storage<org.dasein.util.uom.storage.BytegetObjectSize(@Nullable String bucket, @Nullable String objectthrows InternalExceptionCloudException {
        String resource = bucket + "/" + object;
        AzureStorageMethod method = new AzureStorageMethod();
        String blobProperty = "Content-Length";
        String result = method.getBlobProperty(.resourcenew HashMap<StringString>(), nullnulltrueblobProperty);
        ifresult != null ) {
            return new Storage<org.dasein.util.uom.storage.Byte>(Long.valueOf(result), .);
        }
        return null;
    }
    @Override
    public int getMaxBuckets() throws CloudExceptionInternalException {
        return ;
    }
    @Override
    protected void get(@Nullable String bucket, @Nonnull String object, @Nonnull File toFile, @Nullable FileTransfer transferthrows InternalExceptionCloudException {
        if.isTraceEnabled() ) {
            .trace("ENTER - " + BlobStore.class.getName() + ".get(" + bucket + "," + object + "," + toFile + "," + transfer + ")");
        }
        try {
            ifbucket == null ) {
                throw new CloudException("No bucket was specified");
            }
            StringBuilder resource = new StringBuilder();
            resource.append(bucket);
            resource.append("/");
            resource.append(object);
            AzureStorageMethod method = new AzureStorageMethod();
            InputStream input = method.getAsStream(.resource.toString(), new HashMap<StringString>(), nullnulltrue);
            ifinput == null ) {
                throw new CloudException("No such file: " + bucket + "/" + object);
            }
            try {
                copy(inputnew FileOutputStream(toFile), transfer);
            }
            catchFileNotFoundException e ) {
                .error("Could not find target file to fetch to " + toFile + ": " + e.getMessage());
                throw new InternalException(e);
            }
            catchIOException e ) {
                .error("Could not fetch file to " + toFile + ": " + e.getMessage());
                throw new CloudException(e);
            }
        }
        finally {
            if.isTraceEnabled() ) {
                .trace("EXIT - " + BlobStore.class.getName() + ".get()");
            }
        }
    }
    @Override
        return ;
    }
    @Override
    public int getMaxObjectsPerBucket() throws CloudExceptionInternalException {
        return ;
    }
    @Override
    public @Nonnull String getProviderTermForBucket(@Nonnull Locale locale) {
        return "bucket";
    }
    @Override
    public @Nonnull String getProviderTermForObject(@Nonnull Locale locale) {
        return "object";
    }
    @Override
    public boolean isPublic(@Nullable String bucket, @Nullable String objectthrows CloudExceptionInternalException {
        AzureStorageMethod method = new AzureStorageMethod();
        TreeMap <StringStringqueries = new TreeMap<String,String>();
        String resource;
        ifobject != null ) {
            ifbucket == null ) {
                return false;
            }
            resource = bucket + "/" + object;
        }
        else ifbucket == null ) {
            return false;
        }
        else {
            queries.put("restype""container");
            resource = bucket;
        }
        InputStream input = method.getAsStream(.resourcequeriesnullnullfalse);
        return (input != null);
    }
    @Override
    public boolean isSubscribed() throws CloudExceptionInternalException {
        if.isTraceEnabled() ) {
            .trace("ENTER - " + BlobStore.class.getName() + ".isSubscribed()");
        }
        try {
            return (.getStorageService() != null);
        }
        finally {
            if.isTraceEnabled() ) {
                .trace("EXIT - " + BlobStore.class.getName() + ".isSubscribed()");
            }
        }
    }
    @Override
    public @Nonnull Collection<Bloblist(final @Nullable String bucketthrows CloudExceptionInternalException {
        final ProviderContext ctx = .getContext();
        PopulatorThread <Blobpopulator;
        ifctx == null ) {
            throw new CloudException("No context was specified for this request");
        }
        final String regionId = ctx.getRegionId();
        ifregionId == null ) {
            throw new CloudException("No region ID was specified");
        }
        .hold();
        populator = new PopulatorThread<Blob>(new JiteratorPopulator<Blob>() {
            public void populate(@Nonnull Jiterator<Blobiteratorthrows CloudExceptionInternalException {
                try {
                    list(regionIdbucketiterator);
                }
                finally {
                    .release();
                }
            }
        });
        populator.populate();
        return populator.getResult();
    }
    private void list(@Nonnull String regionId, @Nullable String bucket, @Nonnull Jiterator<Blobiteratorthrows CloudExceptionInternalException {
        ifbucket == null ) {
            loadBuckets(regionIditerator);
        }
        else {
            loadObjects(regionIdbucketiterator);
        }
    }
    private void loadBuckets(@Nonnull String regionId, @Nonnull Jiterator<Blobiteratorthrows CloudExceptionInternalException {
        if.isTraceEnabled() ) {
            .trace("ENTER - " + BlobStore.class.getName() + ".listBuckets()");
        }
        try {
            TreeMap <StringStringqueries = new TreeMap <StringString>();
            AzureStorageMethod method = new AzureStorageMethod();
            queries.put("comp""list");
            Document doc = method.getAsDoc(.""queriesnullnulltrue);
            NodeList matches = doc.getElementsByTagName("Container");
            ifmatches != null ){
                forint i=0; i<matches.getLength(); i++ ) {
                    Blob bucket = toBlob(regionIdmatches.item(i), "/"true);
                    ifbucket != null ) {
                        iterator.push(bucket);
                    }
                }
            }
        }
        finally {
            if.isTraceEnabled() ) {
                .trace("EXIT - " + BlobStore.class.getName() + ".listBuckets()");
            }
        }
    }
    private void loadObjects(@Nonnull String regionId, @Nonnull String bucket, @Nonnull Jiterator<Blobiteratorthrows CloudExceptionInternalException {
        TreeMap <StringStringqueries = new TreeMap <StringString>();
        AzureStorageMethod method = new AzureStorageMethod();
        queries.put("restype""container");
        queries.put("comp""list");
        Document doc = method.getAsDoc(.bucketqueriesnullnulltrue);
        if(doc == nullreturn;
        NodeList matches = doc.getElementsByTagName("Blob");
        if(matches != null){
            forint i=0; i<matches.getLength(); i++ ) {
                Blob file = toBlob(regionIdmatches.item(i), bucketfalse);
                iffile != null ) {
                    iterator.push(file);
                }
            }
        }
    }
    @Override
    public void makePublic(@Nonnull String bucketthrows InternalExceptionCloudException {
        makePublic(bucketnull);
    }
    @Override
    public void makePublic(@Nullable String bucket, @Nullable String objectthrows InternalExceptionCloudException {
        ifbucket == null && object == null ) {
            throw new CloudException("No such object: null/null");
        }
        TreeMap <StringStringqueries = new TreeMap <StringString>();
        TreeMap <StringStringheaders = new TreeMap <StringString>();
        String resource = (object == null ? bucket : (bucket + "/" + object));
        AzureStorageMethod method = new AzureStorageMethod();
        queries.put("restype""container");
        queries.put("comp""acl");
        headers.put("x-ms-blob-public-access","container");
        method.invoke(.resourcequeries,null,headerstrue);
    }
    @Override
    public @Nonnull String[] mapServiceAction(@Nonnull ServiceAction action) {
        return new String[0];
    }
    @Override
    public void move(@Nullable String sourceBucket, @Nullable String object, @Nullable String targetBucketthrows InternalExceptionCloudException {
        ifsourceBucket == null ) {
            throw new CloudException("No source bucket was specified");
        }
        iftargetBucket == null ) {
            throw new CloudException("No target bucket was specified");
        }
        ifobject == null ) {
            throw new CloudException("No source object was specified");
        }
        copy(sourceBucketobjecttargetBucketobject);
        removeObject(sourceBucketobject);
    }
    @Override
    protected void put(@Nullable String bucket, @Nonnull String object, @Nonnull File filethrows CloudExceptionInternalException {
        ifbucket == null ) {
            throw new CloudException("No bucket was specified");
        }
        try {
            InputStream input;
            try {
                input =  new FileInputStream(file);
            }
            catchIOException e ) {
                .error("Error reading input file " + file + ": " + e.getMessage());
                throw new InternalException(e);
            }
            int fileSize = input.available();
            iffileSize > (63 * 1024 * 1024) ) {
                putBlocks(bucketobjectinput);
            }
            else {
                TreeMap <StringStringqueries = new TreeMap <StringString>();
                TreeMap <StringStringheaders = new TreeMap <StringString>();
                AzureStorageMethod method = new AzureStorageMethod();
                String resource = bucket + "/" + object ;
                queries.put("timeout""600");
                headers.put("x-ms-blob-type""BlockBlob");
                headers.put("content-type""application/octet-stream");
                method.putWithFile(.resourcequeriesfileheaderstrue);
            }
        }
        catchIOException e ) {
            .error("Error uploading file " + file + ": " + e.getMessage());
            throw new CloudException(e);
        }
    }
    @Override
    protected void put(@Nullable String bucket, @Nonnull String object, @Nonnull String contentthrows CloudExceptionInternalException {
        TreeMap <StringStringheaders = new TreeMap <StringString>();
        headers.put("x-ms-blob-type""BlockBlob");
        headers.put("content-type""application/octet-stream");
        AzureStorageMethod method = new AzureStorageMethod();
        method.invoke(.bucket + "/" + objectnew HashMap<StringString>(), contentheaderstrue);
    }
    private void putBlocks(@Nonnull String bucket, @Nonnull String object, @Nonnull InputStream inputthrows  InternalExceptionCloudException {
        if.isTraceEnabled() ) {
            .trace("ENTER - " + BlobStore.class.getName() + ".putBlocks(" + bucket + "," + object + ",<<INPUT STREAM>>)");
        }
        try {
            int basicId = 1000;
            int blockSize = 4 * 1024 * 1024;
            byte[] bytes = new byte[blockSize];
            int read;
            try{
                try {
                    while ((read = input.read(bytes)) != -1) {
                        String blockId = Base64.encodeBase64String(String.valueOf(basicId).getBytes());
                        ifread < blockSize ) {
                            byte [] subArray = Arrays.copyOfRange(bytes, 0, read);
                            putBlocks(bucketobjectsubArrayblockId);
                        }
                        else {
                            putBlocks(bucketobjectbytesblockId);
                        }
                        basicId ++;
                    }
                }
                catchIOException e ) {
                    throw new CloudException(e);
                }
            }
            finally{
                try { input.close(); }
                catchThrowable ignore ) { }
                ArrayList<StringblockIds = (ArrayList<String>)getBlocks(objectbucket"all""UncommittedBlocks");
                commitBlocks(objectbucketblockIds);
            }
        }
        finally{
            if.isTraceEnabled() ) {
                .trace("EXIT - " + BlobStore.class.getName() + ".putBlocks()");
            }
        }
    }
    private void putBlocks(@Nonnull String bucket, @Nonnull String object, @Nonnull byte[] content, @Nonnull String blockIdthrows  InternalExceptionCloudException {
        TreeMap <StringStringqueries = new TreeMap <StringString>();
        TreeMap <StringStringheaders = new TreeMap <StringString>();
        AzureStorageMethod method = new AzureStorageMethod();
        String resource = bucket + "/" + object;
        queries.put("blockid"blockId);
        queries.put("comp""block");
        headers.put("x-ms-blob-type""BlockBlob");
        headers.put("content-type""text/plain");
        method.putWithBytes(.resourcequeriescontentheaderstrue);
    }
    @Override
    public void removeBucket(@Nonnull String bucketthrows CloudExceptionInternalException {
        TreeMap <StringStringqueries = new TreeMap <StringString>();
        AzureStorageMethod method = new AzureStorageMethod();
        queries.put("restype""container");
        method.invoke(.bucketqueriesnullnulltrue);
    }
    @Override
    public void removeObject(@Nullable String bucket, @Nonnull String namethrows CloudExceptionInternalException {
        ifbucket == null ) {
            throw new CloudException("No bucket was specified for this request");
        }
        AzureStorageMethod method = new AzureStorageMethod();
        String resource = bucket + "/" + name;
        method.invoke(.resourcenew HashMap<StringString>(), nullnulltrue);
    }
    @Override
    public @Nonnull String renameBucket(@Nonnull String oldName, @Nonnull String newNameboolean findFreeNamethrows CloudExceptionInternalException {
        Blob bucket = createBucket(newNamefindFreeName);
        forBlob file : list(oldName) ) {
            int retries = 10;
            whiletrue ) {
                retries--;
                try {
                    move(oldNamefile.getObjectName(), bucket.getBucketName());
                    break;
                }
                catchCloudException e ) {
                    ifretries < 1 ) {
                        throw e;
                    }
                }
                try { Thread.sleep(retries * 10000L); }
                catchInterruptedException ignore ) { }
            }
        }
        boolean ok = true;
        forBlob file : list(oldName ) ) {
            iffile != null ) {
                ok = false;
            }
        }
        ifok ) {
            removeBucket(oldName);
        }
        return newName;
    }
    @Override
    public void renameObject(@Nullable String bucket, @Nonnull String object, @Nonnull String newNamethrows CloudExceptionInternalException {
        ifbucket == null ) {
            throw new CloudException("No bucket was specified");
        }
        copy(bucketobjectbucketnewName);
        removeObject(bucketobject);
    }
    @Override
    public @Nonnull Blob upload(@Nonnull File source, @Nullable String bucket, @Nonnull String fileNamethrows CloudExceptionInternalException {
        ifbucket == null ) {
            throw new OperationNotSupportedException("Root objects not supported in cloud");
        }
        if( !exists(bucket) ) {
            createBucket(bucketfalse);
        }
        put(bucketfileNamesource);
        return getObject(bucketfileName);
    }
    @Override
    public @Nonnull
        return NamingConstraints.getAlphaNumeric(1, 255).constrainedBy(new char[] { '-''.' }).limitedToLatin1().lowerCaseOnly();
    }
    @Override
    public @Nonnull NamingConstraints getObjectNameRules() throws CloudExceptionInternalException {
        return NamingConstraints.getAlphaNumeric(1, 255).constrainedBy(new char[] { '-''.'',''#''+' }).limitedToLatin1().lowerCaseOnly();
    }
    private @Nullable Blob toBlob(@Nonnull String regionId, @Nullable Node node, @Nonnull String bucketboolean isContainer) {
        ifnode == null ) {
            return null;
        }
        NodeList attributes = node.getChildNodes();
        String object = nulllocation = null;
        long size = -1L, creationDate = 0L;
        forint i=0; i<attributes.getLength(); i++ ) {
            Node attribute = attributes.item(i);
            ifattribute.getNodeType() == . ) {
                continue;
            }
            String aname = attribute.getNodeName().toLowerCase();
            String value;
            ifattribute.getChildNodes().getLength() > 0 ) {
                value = attribute.getFirstChild().getNodeValue();
            }
            else {
                continue;
            }
            ifaname.equalsIgnoreCase("Name") ) {
                object = value;
            }
            else ifaname.equalsIgnoreCase("Url") ) {
                location = value;
            }
            else ifaname.equalsIgnoreCase("Properties") ) {
                NodeList propertyAttributes  = attribute.getChildNodes();
                for(int j=0;j<propertyAttributes.getLength();j++ ){
                    Node property = propertyAttributes.item(j);
                    String propertyName = property.getNodeName();
                    String propertyValue;
                    ifproperty.getChildNodes().getLength() > 0 ) {
                        propertyValue = property.getFirstChild().getNodeValue();
                    }
                    else{
                        continue;
                    }
                    ifpropertyName.equalsIgnoreCase("Content-Length") ) {
                        size = Long.valueOf(propertyValue);
                    }
                    else ifpropertyName.equalsIgnoreCase("Last-Modified") ) {
                        String RFC1123_PATTERN = "EEE, dd MMM yyyy HH:mm:ss z";
                        DateFormat rfc1123Format = new SimpleDateFormat(RFC1123_PATTERN);
                        rfc1123Format.setTimeZone(TimeZone.getTimeZone("GMT"));
                        try {
                            creationDate = rfc1123Format.parse(propertyValue).getTime();
                        }
                        catch (ParseException e) {
                            .warn("Invalid date: " + propertyValue);
                        }
                    }
                }
            }
        }
        ifisContainer ) {
            return Blob.getInstance(regionIdlocationobjectcreationDate);
        }
        else {
            return Blob.getInstance(regionIdlocationbucketobjectcreationDatenew Storage<Byte>(size.));
        }
    }
New to GrepCode? Check out our FAQ X