Closed GoogleCodeExporter closed 8 years ago
I believe either the jets3t API or the S3 API has changed since this code was
originally written. I have this code working with Alfresco Enterprise version
4.0.2 which should be fairly similar to 4.0.d.
First change S3ContentStore.java:
Change the line in the S3ContentStore constructor
bucket = s3.createBucket(bucketName);
To
bucket = s3.getOrCreateBucket(bucketName);
This should help some of the 404 errors.
Second change, in S3ContentReader:
Add the following to the getDetails() method, inside the catch block:
} catch (S3ServiceException e) {
if(e.getResponseCode() == 404) {
// The object key doesn't exist, create it and try again
try {
s3.putObject(bucket, new S3Object(nodeUrl));
objectDetails = s3.getObjectDetails(bucket, nodeUrl);
return;
} catch (S3ServiceException e1) {
logger.error("S3ContentReader Failed to get Object Details, attempted to create object ["+nodeUrl+"]: " + e1.getMessage());
e1.printStackTrace();
}
}
logger.error("S3ContentReader Failed to get Object Details: " + e.getMessage());
Hope that helps.
Michael
Original comment by mmccar...@gmail.com
on 16 Aug 2012 at 8:56
Thanks, it works :) I just need to update jets3t version from 0.6 to 0.9.
Thanks Michael!
Original comment by liferay....@gmail.com
on 17 Aug 2012 at 5:02
Closing
Original issue reported on code.google.com by
liferay....@gmail.com
on 15 Aug 2012 at 5:27