public static AccessKeys GetAccessKeys(string bucket)
{
var connectionsPath = FileLocator.GetFileDistributedWithApplication("connections.dll");
var lines = RobustFile.ReadAllLines(connectionsPath);
switch(bucket)
{
case BloomS3Client.SandboxBucketName:
// S3 'uploaderDev' user, who has permission to use the BloomLibraryBooks-Sandbox bucket.
//parse.com silbloomlibrarysandbox
return new AccessKeys(lines[2], lines[3],lines[6],lines[7]);
case BloomS3Client.UnitTestBucketName:
return new AccessKeys(lines[2], lines[3], lines[8], lines[9]);
case BloomS3Client.ProductionBucketName:
//S3 'uploader' user, who has permission to use the BloomLibraryBooks bucket
//parse.com silbloomlibrary
return new AccessKeys(lines[0], lines[1], lines[4], lines[5]);
case BloomS3Client.ProblemBookUploadsBucketName:
return new AccessKeys(lines[2], lines[3], null,null);
case BloomS3Client.BloomDesktopFiles:
// For now, this is public read, and no one needs to write.
return new AccessKeys(null, null, null, null);
default: throw new ApplicationException("Bucket name not recognized: " + bucket);
}
}