return new S3BucketAction();
}
else {
String objectKey = pathInfo.substring(1);
request.setAttribute(S3Constants.OBJECT_ATTR_KEY, objectKey);
return new S3ObjectAction();
}
}
else
{
int endPos = pathInfo.indexOf('/'); // Subsequent / character?
if (endPos < 1)
{
bucketName = pathInfo;
S3Engine.verifyBucketName( bucketName, false );
request.setAttribute(S3Constants.BUCKET_ATTR_KEY, bucketName);
return new S3BucketAction();
}
else
{
bucketName = pathInfo.substring(0, endPos);
key = pathInfo.substring(endPos + 1);
S3Engine.verifyBucketName( bucketName, false );
if (!key.isEmpty())
{
request.setAttribute(S3Constants.BUCKET_ATTR_KEY, bucketName);
request.setAttribute(S3Constants.OBJECT_ATTR_KEY, pathInfo.substring(endPos + 1));
return new S3ObjectAction();
}
else {
request.setAttribute(S3Constants.BUCKET_ATTR_KEY, bucketName);
return new S3BucketAction();
}