private static void GenericGetBucket() throws IOException
	{
		System.out.println("generic get bucket");
		
		String bucketName="chttest1";
		String fileName="apple.jpg";
		String fileName2="photos/2006/January/sample.jpg";
		String fileName3="photos/2006/February/sample2.jpg";
		String fileName4="asset.txt";
		String fileName5="photos/2006/February/sample3.jpg";
		
		AmazonS3 s3 = new AmazonS3Client(new PropertiesCredentials(putBucket.class.getResourceAsStream("AwsCredentials.properties")));
		try
		{
			//System.out.println("Creating bucket " + bucketName + "\n");
	       // s3.createBucket(bucketName);
	        
	         
            System.out.println("Uploading a new object to S3 from a file\n");
            s3.putObject(new PutObjectRequest(bucketName, fileName, createSampleFile()));
            s3.putObject(new PutObjectRequest(bucketName, fileName2, createSampleFile()));
            s3.putObject(new PutObjectRequest(bucketName, fileName3, createSampleFile()));
            s3.putObject(new PutObjectRequest(bucketName, fileName4, createSampleFile()));
            s3.putObject(new PutObjectRequest(bucketName, fileName5, createSampleFile()));
            
            System.out.println("Listing object from bucket (prefix)\n"); //test prefix=photos/
            ObjectListing objectListing = s3.listObjects(new ListObjectsRequest()
            .withBucketName(bucketName)
            .withPrefix("photos/"));           
            for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
                System.out.println(" - " + objectSummary.getKey() + "  " +
                                   "(size = " + objectSummary.getSize() + ")");
            }
	        System.out.println();
	        
            System.out.println("Listing object from bucket (delimeter)\n"); //test delimiter=/
            objectListing = s3.listObjects(new ListObjectsRequest()
            .withBucketName(bucketName)
            .withDelimiter("/"));         

            if(objectListing.getObjectSummaries().equals("[]"))
            {   
            	for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) 
            	{
            		System.out.println(" - " + objectSummary.getKey() + "  " + "(size = " + objectSummary.getSize() + ")");
            	}
            }
			System.out.println("Common Prefix: "+ objectListing.getCommonPrefixes());
	        System.out.println();
	        
            System.out.println("Listing object from bucket (delimiter & prefix)\n"); //test delimiter=photos/2006/ & prefix=/
            objectListing = s3.listObjects(new ListObjectsRequest().withBucketName(bucketName).withPrefix("photos/2006/").withDelimiter("/")); 
            
            if(objectListing.getObjectSummaries().equals("[]"))
            {
            	for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) 
            	{
	            	System.out.println(objectSummary.getBucketName());
	                System.out.println(" - " + objectSummary.getKey() + "  " +
	                                   "(size = " + objectSummary.getSize() + ")");
	                System.out.println(objectSummary.getOwner());
            	}
            }
	        System.out.println("common prefix: "+ objectListing.getCommonPrefixes());
	        System.out.println("Delimiter: "+ objectListing.getDelimiter());
	        System.out.println("Prefix: "+ objectListing.getPrefix());
	        System.out.println("BucketName: "+ objectListing.getBucketName());
	        System.out.println();
	        
            System.out.println("Listing object from bucket (max key)\n"); //test max key
            objectListing = s3.listObjects(new ListObjectsRequest()
            .withBucketName(bucketName)
            .withMaxKeys(2));           
            for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
                System.out.println(" - " + objectSummary.getKey() + "  " +
                                   "(size = " + objectSummary.getSize() + ")");
            }
	        System.out.println();
	        
            System.out.println("Listing object from bucket (marker)\n"); //test marker
            objectListing = s3.listObjects(new ListObjectsRequest()
            .withBucketName(bucketName)
            .withMarker(fileName));           
            for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
                System.out.println(" - " + objectSummary.getKey() + "  " +
                                   "(size = " + objectSummary.getSize() + ")");
            }
	        System.out.println();	        

		}
		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());
	    }
	}