-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add builder to get bucket version config
- Loading branch information
1 parent
73ad509
commit 479614e
Showing
5 changed files
with
186 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio; | ||
|
||
/** Argument class of MinioClient.isVersioningEnabled(). */ | ||
public class IsVersioningEnabledArgs extends BucketArgs { | ||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
/** Argument builder of {@link IsVersioningEnabledArgs}. */ | ||
public static final class Builder extends BucketArgs.Builder<Builder, IsVersioningEnabledArgs> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
api/src/main/java/io/minio/messages/VersioningConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.messages; | ||
|
||
import org.simpleframework.xml.Element; | ||
import org.simpleframework.xml.Namespace; | ||
import org.simpleframework.xml.Root; | ||
|
||
/** | ||
* Object representation of request XML of <a | ||
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html">PutBucketVersioning | ||
* API</a> and response XML of <a | ||
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html">GetBucketVersioning | ||
* API</a>. | ||
*/ | ||
@Root(name = "VersioningConfiguration", strict = false) | ||
@Namespace(reference = "http://s3.amazonaws.com/doc/2006-03-01/") | ||
public class VersioningConfiguration { | ||
@Element(name = "Status", required = false) | ||
private String status; | ||
|
||
public VersioningConfiguration() {} | ||
|
||
/** Constructs a new VersioningConfiguration object with given status. */ | ||
public VersioningConfiguration(String status) { | ||
this.status = status; | ||
} | ||
|
||
/** Indicates whether the bucket is version enabled or not. */ | ||
public boolean status() { | ||
return status != null && status.equals("Enabled"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters