public void Initialize()
{
relativeFilePath = S3TestUtils.GetFileHelper("PutObjectFile.txt");
using (StreamWriter writer = File.CreateText(relativeFilePath))
{
writer.Write("This is some sample text.!!");
writer.Close();
}
bucketName = "unity-test-bucket" + DateTime.Now.Ticks;
AutoResetEvent ars = new AutoResetEvent(false);
Exception exception = null;
Client.PutBucketAsync(bucketName, (result) =>
{
if (result.Exception != null)
{
exception = result.Exception;
}
ars.Set();
});
ars.WaitOne();
if (exception != null)
{
throw exception;
}
}