Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup code #312

Merged
merged 2 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,18 @@ try
bool found = await minioClient.BucketExistsAsync("mybucket");
if (found)
{
Console.Out.WriteLine("mybucket already exists");
Console.WriteLine("mybucket already exists");
}
else
{
// Create bucket 'my-bucketname'.
await minioClient.MakeBucketAsync("mybucket");
Console.Out.WriteLine("mybucket is created successfully");
Console.WriteLine("mybucket is created successfully");
}
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -191,12 +191,12 @@ try
var list = await minioClient.ListBucketsAsync();
foreach (Bucket bucket in list.Buckets)
{
Console.Out.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);
Console.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);
}
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -236,7 +236,7 @@ try
{
// Check whether 'my-bucketname' exists or not.
bool found = await minioClient.BucketExistsAsync(bucketName);
Console.Out.WriteLine("bucket-name " + ((found == true) ? "exists" : "does not exist"));
Console.WriteLine("bucket-name " + ((found == true) ? "exists" : "does not exist"));
}
catch (MinioException e)
{
Expand Down Expand Up @@ -288,16 +288,16 @@ try
{
// Remove bucket my-bucketname. This operation will succeed only if the bucket is empty.
await minioClient.RemoveBucketAsync("mybucket");
Console.Out.WriteLine("mybucket is removed successfully");
Console.WriteLine("mybucket is removed successfully");
}
else
{
Console.Out.WriteLine("mybucket does not exist");
Console.WriteLine("mybucket does not exist");
}
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -343,12 +343,12 @@ try
}
else
{
Console.Out.WriteLine("mybucket does not exist");
Console.WriteLine("mybucket does not exist");
}
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -396,12 +396,12 @@ try
}
else
{
Console.Out.WriteLine("mybucket does not exist");
Console.WriteLine("mybucket does not exist");
}
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -438,11 +438,11 @@ __Example__
try
{
String policyJson = await minioClient.GetPolicyAsync("myBucket");
Console.Out.WriteLine("Current policy: " + policy.GetType().ToString());
Console.WriteLine("Current policy: " + policy.GetType().ToString());
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -481,7 +481,7 @@ try
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -531,11 +531,11 @@ try

await minio.SetBucketNotificationsAsync(bucketName,
notification);
Console.Out.WriteLine("Notifications set for the bucket " + bucketName + " successfully");
Console.WriteLine("Notifications set for the bucket " + bucketName + " successfully");
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -572,11 +572,11 @@ __Example__
try
{
BucketNotification notifications = await minioClient.GetBucketNotificationAsync(bucketName);
Console.Out.WriteLine("Notifications is " + notifications.ToXML());
Console.WriteLine("Notifications is " + notifications.ToXML());
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -613,11 +613,11 @@ __Example__
try
{
await minioClient.RemoveAllBucketNotificationsAsync(bucketName);
Console.Out.WriteLine("Notifications successfully removed from the bucket " + bucketName);
Console.WriteLine("Notifications successfully removed from the bucket " + bucketName);
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -672,7 +672,7 @@ try
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -727,7 +727,7 @@ try
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -775,7 +775,7 @@ try
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```
<a name="putObject"></a>
Expand Down Expand Up @@ -834,11 +834,11 @@ try
filestream,
filestream.Length,
"application/octet-stream", ssec);
Console.Out.WriteLine("island.jpg is uploaded successfully");
Console.WriteLine("island.jpg is uploaded successfully");
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -884,11 +884,11 @@ The maximum size of a single object is limited to 5TB. putObject transparently u
try
{
await minio.PutObjectAsync("mybucket", "island.jpg", "/mnt/photos/island.jpg", contentType: "application/octet-stream");
Console.Out.WriteLine("island.jpg is uploaded successfully");
Console.WriteLine("island.jpg is uploaded successfully");
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```
<a name="statObject"></a>
Expand Down Expand Up @@ -927,11 +927,11 @@ try
{
// Get the metadata of the object.
ObjectStat objectStat = await minioClient.StatObjectAsync("mybucket", "myobject");
Console.Out.WriteLine(objectStat);
Console.WriteLine(objectStat);
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -987,11 +987,11 @@ try
sseDst = new SSES3();
*/
await minioClient.CopyObjectAsync("mybucket", "island.jpg", "mydestbucket", "processed.png", copyConditions, sseSrc:sseSrc, sseDest:sseDst);
Console.Out.WriteLine("island.jpg is uploaded successfully");
Console.WriteLine("island.jpg is uploaded successfully");
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -1028,11 +1028,11 @@ try
{
// Remove objectname from the bucket my-bucketname.
await minioClient.RemoveObjectAsync("mybucket", "myobject");
Console.Out.WriteLine("successfully removed mybucket/myobject");
Console.WriteLine("successfully removed mybucket/myobject");
}
catch (MinioException e)
{
Console.Out.WriteLine("Error: " + e);
Console.WriteLine("Error: " + e);
}
```
<a name="removeObjects"></a>
Expand Down Expand Up @@ -1082,7 +1082,7 @@ try
}
catch (MinioException e)
{
Console.Out.WriteLine("Error: " + e);
Console.WriteLine("Error: " + e);
}
```

Expand Down Expand Up @@ -1119,11 +1119,11 @@ try
{
// Removes partially uploaded objects from buckets.
await minioClient.RemoveIncompleteUploadAsync("mybucket", "myobject");
Console.Out.WriteLine("successfully removed all incomplete upload session of my-bucketname/my-objectname");
Console.WriteLine("successfully removed all incomplete upload session of my-bucketname/my-objectname");
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -1161,11 +1161,11 @@ __Example__
try
{
String url = await minioClient.PresignedGetObjectAsync("mybucket", "myobject", 60 * 60 * 24);
Console.Out.WriteLine(url);
Console.WriteLine(url);
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -1200,11 +1200,11 @@ __Example__
try
{
String url = await minioClient.PresignedPutObjectAsync("mybucket", "myobject", 60 * 60 * 24);
Console.Out.WriteLine(url);
Console.WriteLine(url);
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```

Expand Down Expand Up @@ -1253,11 +1253,11 @@ try
curlCommand = curlCommand + " -F " + pair.Key + "=" + pair.Value;
}
curlCommand = curlCommand + " -F file=@/etc/bashrc https://s3.amazonaws.com/my-bucketname";
Console.Out.WriteLine(curlCommand);
Console.WriteLine(curlCommand);
}
catch(MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
Console.WriteLine("Error occurred: " + e);
}
```
## Client Custom Settings
Expand Down
12 changes: 6 additions & 6 deletions FileUploader/FileUpload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

using Minio;
using System;
using System.Threading.Tasks;
using System.Net;
using Minio;
using System.Threading.Tasks;

namespace FileUploader
{
Expand All @@ -42,7 +42,7 @@ static void Main(string[] args)
}
catch (Exception ex)
{
Console.Out.WriteLine(ex.Message);
Console.WriteLine(ex.Message);
}
Console.ReadLine();
}
Expand Down Expand Up @@ -70,12 +70,12 @@ private static async Task Run(MinioClient minio)
await minio.MakeBucketAsync(bucketName, location);
}
await minio.PutObjectAsync(bucketName, objectName, filePath, contentType);
Console.Out.WriteLine("Successfully uploaded " + objectName);
Console.WriteLine("Successfully uploaded " + objectName);
}
catch (Exception e)
{
Console.Out.WriteLine(e);
Console.WriteLine(e);
}
}
}
}
}
6 changes: 3 additions & 3 deletions Minio.Examples/Cases/BucketExists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public async static Task Run(MinioClient minio,
{
try
{
Console.Out.WriteLine("Running example for API: BucketExistsAsync");
Console.WriteLine("Running example for API: BucketExistsAsync");
bool found = await minio.BucketExistsAsync(bucketName);
Console.Out.WriteLine((found ? "Found" : "Couldn't find ") + "bucket " + bucketName);
Console.Out.WriteLine();
Console.WriteLine((found ? "Found" : "Couldn't find ") + "bucket " + bucketName);
Console.WriteLine();
}
catch (Exception e)
{
Expand Down
Loading