|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AmazonS3
Interface for interacting with an Amazon S3 repository.
| Method Summary | |
|---|---|
void |
createBucket(String name)
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 file)
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. |
| Method Detail |
|---|
void createBucket(String name)
throws IOException
name - 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.
void deleteBucket(String bucketName)
throws IOException
bucketName - 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.
void putPrivateFile(String bucketName,
File file)
throws IOException
bucketName - 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.
void putPublicFile(String bucketName,
File file)
throws IOException
bucketName - 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.
void putPublicFile(String bucketName,
File file,
String mimeType)
throws IOException
bucketName - 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.
void getPrivateFile(String bucketName,
String fileName,
File target)
throws IOException
bucketName - 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.
void getPublicFile(String bucketName,
String fileName,
File target)
throws IOException
bucketName - 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.
void normalizeRequest(org.apache.commons.httpclient.HttpMethod method,
String methodString,
String fullPath,
boolean addPublicHeader,
boolean useAuth)
method - 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.
void delete(String bucketName,
String fileName)
throws IOException
bucketName - 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.
void deleteStar(String bucketName,
String file)
throws IOException
bucketName - The bucket.file - 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.
void listBucket(String bucketName)
throws IOException
bucketName - 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.
void putPrivateDir(String bucketName,
File dir)
throws IOException
bucketName - 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.
void putPublicDir(String bucketName,
File dir)
throws IOException
bucketName - 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.
void listBuckets()
throws IOException
IOException - If we could either could not make a network
connection to S3 or could not understand the HTTP exchange.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||