|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lastbamboo.common.amazon.s3.AmazonS3Impl
public class AmazonS3Impl
Class implementing REST calls to Amazon's S3 service.
| Constructor Summary | |
|---|---|
AmazonS3Impl()
Creates a new S3 instance. |
|
| Method Summary | |
|---|---|
void |
createBucket(String bucketName)
Creates a new bucket. |
void |
delete(String bucketName,
String fileName)
Deletes the specified file. |
void |
deleteBucket(String bucketName)
Deletes the bucket with the specified name. |
void |
deleteStar(String bucketName,
String fileName)
Deletes all of the files in the specified bucket matching the specified pattern. |
void |
getPrivateFile(String bucketName,
String fileName,
File target)
Downloads a file from the specified bucket and file name to the specified local path. |
void |
getPublicFile(String bucketName,
String fileName,
File target)
Downloads a file from the specified bucket and file name to the specified local path. |
void |
listBucket(String bucketName)
List all the files in the bucket. |
void |
listBuckets()
Lists all the user's buckets. |
void |
normalizeRequest(org.apache.commons.httpclient.HttpMethod method,
String methodString,
String fullPath,
boolean addPublicHeader,
boolean useAuth)
Normalizes the HTTP request headers with things like the authentication token, the date, etc. |
void |
putPrivateDir(String bucketName,
File dir)
Adds all the files in the specified directory to the specified bucket. |
void |
putPrivateFile(String bucketName,
File file)
Uploads a file to S3. |
void |
putPublicDir(String bucketName,
File dir)
Adds all the files in the specified directory to the specified bucket. |
void |
putPublicFile(String bucketName,
File file)
Uploads a file to S3 that will be publicly available. |
void |
putPublicFile(String bucketName,
File file,
String mimeType)
Uploads a file to S3 that will be publicly available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AmazonS3Impl()
throws IOException
IOException - If the props file can't be found or keys can't be read.| Method Detail |
|---|
public void getPrivateFile(String bucketName,
String fileName,
File target)
throws IOException
AmazonS3
getPrivateFile in interface AmazonS3bucketName - The name of the Amazon S3 bucket.fileName - The name of the file within the bucket.target - The name of the local file to download to.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void getPublicFile(String bucketName,
String fileName,
File target)
throws IOException
AmazonS3
getPublicFile in interface AmazonS3bucketName - The name of the Amazon S3 bucket.fileName - The name of the file within the bucket.target - The name of the local file to download to.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void putPrivateFile(String bucketName,
File file)
throws IOException
AmazonS3
putPrivateFile in interface AmazonS3bucketName - The name of the bucket.file - The file to upload.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void putPrivateDir(String bucketName,
File dir)
throws IOException
AmazonS3
putPrivateDir in interface AmazonS3bucketName - The name of the bucket to list.dir - The directory containing files to add.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void putPublicFile(String bucketName,
File file)
throws IOException
AmazonS3
putPublicFile in interface AmazonS3bucketName - The name of the bucket.file - The file to upload.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void putPublicFile(String bucketName,
File file,
String mimeType)
throws IOException
AmazonS3
putPublicFile in interface AmazonS3bucketName - The name of the bucket.file - The file to upload.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void putPublicDir(String bucketName,
File dir)
throws IOException
AmazonS3
putPublicDir in interface AmazonS3bucketName - The name of the bucket to list.dir - The directory containing files to add.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void createBucket(String bucketName)
throws IOException
AmazonS3
createBucket in interface AmazonS3bucketName - The name of the bucket.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void listBuckets()
throws IOException
AmazonS3
listBuckets in interface AmazonS3IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void listBucket(String bucketName)
throws IOException
AmazonS3
listBucket in interface AmazonS3bucketName - The name of the bucket to list.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void deleteBucket(String bucketName)
throws IOException
AmazonS3
deleteBucket in interface AmazonS3bucketName - The name of the bucket to delete.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void delete(String bucketName,
String fileName)
throws IOException
AmazonS3
delete in interface AmazonS3bucketName - The bucket.fileName - The file name.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void deleteStar(String bucketName,
String fileName)
throws IOException
AmazonS3
deleteStar in interface AmazonS3bucketName - The bucket.fileName - The file(s) to delete. This can be of the form "*.txt*, "file*" or *ile*",
for example.
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
public void normalizeRequest(org.apache.commons.httpclient.HttpMethod method,
String methodString,
String fullPath,
boolean addPublicHeader,
boolean useAuth)
AmazonS3
normalizeRequest in interface AmazonS3method - The HTTP method.methodString - The HTTP method string, such as "PUT" or "GET".fullPath - The full path for the resource.addPublicHeader - Whether or not to add the header to make a
resource publicly accessible, as in:x-amz-acl: public-read
useAuth - Whether or not to add the authentication header.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||