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

docs: Fix erroneous {set,get}BucketPolicy documentation #562

Merged
merged 1 commit into from
Apr 26, 2017
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
2 changes: 1 addition & 1 deletion api/src/main/java/io/minio/MinioClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2966,7 +2966,7 @@ private void setBucketPolicy(String bucketName, BucketPolicy policy)
* @param policyType Enum of {@link PolicyType}.
*
* </p><b>Example:</b><br>
* <pre>{@code setBucketPolicy("my-bucketname", "my-objectname", BucketPolicy.ReadOnly); }</pre>
* <pre>{@code setBucketPolicy("my-bucketname", "my-objectname", PolicyType.READ_ONLY); }</pre>
*/
public void setBucketPolicy(String bucketName, String objectPrefix, PolicyType policyType)
throws InvalidBucketNameException, InvalidObjectPrefixException, NoSuchAlgorithmException,
Expand Down
12 changes: 6 additions & 6 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ try {

<a name="getBucketPolicy"></a>
### getBucketPolicy(String bucketName, String objectPrefix)
`public BucketPolicy getBucketPolicy(String bucketName, String objectPrefix)`
`public PolicyType getBucketPolicy(String bucketName, String objectPrefix)`

Get bucket policy at given objectPrefix.

Expand All @@ -467,7 +467,7 @@ __Parameters__

| Return Type | Exceptions |
|:--- |:--- |
| ``BucketPolicy``: The current bucket policy for given bucket and objectPrefix. | Listed Exceptions: |
| ``PolicyType``: The current bucket policy type for a given bucket and objectPrefix. | Listed Exceptions: |
| | ``InvalidBucketNameException`` : upon invalid bucket name. |
| | ``NoResponseException`` : upon no response from server. |
| | ``IOException`` : upon connection error. |
Expand All @@ -492,8 +492,8 @@ try {
```

<a name="setBucketPolicy"></a>
### setBucketPolicy(String bucketName, String objectPrefix, BucketPolicy bucketPolicy)
`public void setBucketPolicy(String bucketName, String objectPrefix, BucketPolicy bucketPolicy)`
### setBucketPolicy(String bucketName, String objectPrefix, PolicyType policy)
`public void setBucketPolicy(String bucketName, String objectPrefix, PolicyType policy)`

Set policy on bucket and object prefix.

Expand All @@ -505,7 +505,7 @@ __Parameters__
|:--- |:--- |:--- |
| ``bucketName`` | _String_ | Name of the bucket. |
| ``objectPrefix`` | _String_ | Policy applies to objects with prefix. |
| ``bucketPolicy`` | _BucketPolicy_ | Policy to apply. |
| ``policy`` | _PolicyType_ | Policy to apply, available types are [PolicyType.NONE, PolicyType.READ_ONLY, PolicyType.READ_WRITE, PolicyType.WRITE_ONLY]. |


| Return Type | Exceptions |
Expand All @@ -529,7 +529,7 @@ __Example__

```java
try {
minioClient.setBucketPolicy("myBucket", "uploads", BucketPolicy.WriteOnly);
minioClient.setBucketPolicy("myBucket", "uploads", PolicyType.READ_ONLY);
} catch (MinioException e) {
System.out.println("Error occurred: " + e);
}
Expand Down