Package com.amazonaws.services.s3

Examples of com.amazonaws.services.s3.AmazonS3Client.deleteObject()


            /*
             * Delete an object - Unless versioning has been turned on for your bucket,
             * there is no way to undelete an object, so use caution when deleting objects.
             */
            System.out.println("Deleting an object\n");
            s3.deleteObject(bucketName, key);

            /*
             * Delete a bucket - A bucket must be completely empty before it can be
             * deleted, so remember to delete any objects from your buckets before
             * you try to delete them.
View Full Code Here


        if (checkEnvs()) {
            AmazonS3Client client = main.getClient();
            for (S3Asset asset : stuffToCleanup) {
                try {
                    log.info("cleanupS3Assets: deleting "+asset);
                    client.deleteObject(asset.bucket, asset.key);
                } catch (Exception e) {
                    log.error("Error cleaning up object: "+asset+": "+e.getMessage());
                }
            }
            main = null;
View Full Code Here

        resp.setStatus(200);

        AWSCredentials myCredentials = new BasicAWSCredentials(AWS_PUBLIC_KEY_SERVER, AWS_SECRET_KEY_SERVER);
        AmazonS3 s3Client = new AmazonS3Client(myCredentials);
        s3Client.deleteObject(bucket, key);
    }


    private void setContentType(HttpServletRequest req, HttpServletResponse resp)
    {
View Full Code Here

            /*
             * Delete an object - Unless versioning has been turned on for your bucket,
             * there is no way to undelete an object, so use caution when deleting objects.
             */
            System.out.println("Deleting an object\n");
            s3.deleteObject(bucketName, key);

            /*
             * Delete a bucket - A bucket must be completely empty before it can be
             * deleted, so remember to delete any objects from your buckets before
             * you try to delete them.
View Full Code Here

    {
        RefCountedClient holder = client.get();
        AmazonS3Client amazonS3Client = holder.useClient();
        try
        {
            amazonS3Client.deleteObject(bucket, key);
        }
        finally
        {
            holder.release();
        }
View Full Code Here

            /*
             * Delete an object - Unless versioning has been turned on for your bucket,
             * there is no way to undelete an object, so use caution when deleting objects.
             */
            System.out.println("Deleting an object\n");
            s3.deleteObject(bucketName, key);

            /*
             * Delete a bucket - A bucket must be completely empty before it can be
             * deleted, so remember to delete any objects from your buckets before
             * you try to delete them.
View Full Code Here

        String path = file.getPath().substring(resources.getDirectory().length());
        String key = concat("/", keyPrefix, path).substring(1);

        // Delete old file version in bucket
        getLog().debug("Removing existing object at " + key);
        uploadClient.deleteObject(bucket, key);

        // Setup meta data
        ObjectMetadata meta = new ObjectMetadata();
        meta.setCacheControl("public, max-age=" + String.valueOf(valid * 3600));

 
View Full Code Here

       * Delete an object - Unless versioning has been turned on for your
       * bucket, there is no way to undelete an object, so use caution when
       * deleting objects.
       */
      logger.info("Deleting an object\n");
      s3.deleteObject(bucketName, key);

      /*
       * Delete a bucket - A bucket must be completely empty before it can be
       * deleted, so remember to delete any objects from your buckets before you
       * try to delete them.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.