private static void GeneralCopyObject(String sbName , String sfName, String dbName , String dfName) throws IOException
    {
    	String sbucketName = sbName;
    	String dbucketName = dbName;
    	String sfileName = sfName;
    	String dfileName = dfName;
    	StorageClass storageClass = null;
    	CannedAccessControlList cannedAcl = null;
    	ObjectMetadata metadata = new ObjectMetadata() ;
		Date date = new Date();
		date.setYear(date.getYear()-10);
		date.setMonth(date.getMonth()+1);
		date.setDate(date.getDate());
    	
		Date date2 = new Date();
		date2.setYear(date2.getYear());
		date2.setMonth(date2.getMonth()+2);
		date2.setDate(date2.getDate());
		
		AmazonS3 s3 = new AmazonS3Client(new PropertiesCredentials(putBucket.class.getResourceAsStream("AwsCredentials.properties")));
		try
		{
			metadata.addUserMetadata("x-amz-meta-company", "chttl");
			metadata.addUserMetadata("x-amz-meta-department", "cloud");
			metadata.setContentType("image/jpeg");
	            
            System.out.println("Copy object...\n");
            //with storage class
            //CopyObjectResult result = s3.copyObject(new CopyObjectRequest(sbucketName, sfileName, dbucketName, dfileName).withStorageClass(storageClass.ReducedRedundancy));
            
            //with storageClass, acl, metadata, if-match, if-modify-since
            //CopyObjectResult result = s3.copyObject(new CopyObjectRequest(sbucketName, sfileName, dbucketName, dfileName).withStorageClass("STANDARD").withCannedAccessControlList(cannedAcl.PublicRead).withNewObjectMetadata(metadata).withMatchingETagConstraint("692b09f0ffdcd397f6af4243a1259b1e").withModifiedSinceConstraint(date));
            
            //with if-non-match
            //CopyObjectResult result = s3.copyObject(new CopyObjectRequest(sbucketName, sfileName, dbucketName, dfileName).withNonmatchingETagConstraint("692b09f0ffdcd397f6af4243a1259b1c"));
            
            //with if-non-modify-since
    		//CopyObjectResult result = s3.copyObject(new CopyObjectRequest(sbucketName, sfileName, dbucketName, dfileName).withUnmodifiedSinceConstraint(date2));
    		
            //with version id
            CopyObjectResult result = s3.copyObject(new CopyObjectRequest(sbucketName, sfileName, dbucketName, dfileName).withSourceVersionId("72b3f39f520c411db753039b7567d069"));
            
            System.out.println(result.getETag());
            System.out.println(result.getLastModifiedDate());
		}
		catch (AmazonServiceException ase) {
            System.out.println("Caught an AmazonServiceException, which means your request made it "
                    + "to Amazon S3, but was rejected with an error response for some reason.");
            System.out.println("Error Message:    " + ase.getMessage());
            System.out.println("HTTP Status Code: " + ase.getStatusCode());
            System.out.println("AWS Error Code:   " + ase.getErrorCode());
            System.out.println("Error Type:       " + ase.getErrorType());
            System.out.println("Request ID:       " + ase.getRequestId());
        } catch (AmazonClientException ace) {
            System.out.println("Caught an AmazonClientException, which means the client encountered "
                    + "a serious internal problem while trying to communicate with S3, "
                    + "such as not being able to access the network.");
            System.out.println("Error Message: " + ace.getMessage());
        }
    }