View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.aws.s3.pojo;
17  
18  import com.amazonaws.services.s3.model.Bucket;
19  
20  public class BucketPrefixSummary implements Comparable<BucketPrefixSummary> {
21  
22  	Bucket bucket;
23  	String prefix;
24  	long count;
25  	long size;
26  
27  	public BucketPrefixSummary() {
28  		this(null);
29  	}
30  
31  	public BucketPrefixSummary(String prefix) {
32  		super();
33  		this.prefix = prefix;
34  	}
35  
36  	public int compareTo(BucketPrefixSummary other) {
37  		String prefix1 = getPrefix();
38  		String prefix2 = other.getPrefix();
39  		if (prefix1 == null) {
40  			return -1;
41  		} else {
42  			return prefix1.compareTo(prefix2);
43  		}
44  	}
45  
46  	public long getCount() {
47  		return count;
48  	}
49  
50  	public void setCount(long objectCount) {
51  		this.count = objectCount;
52  	}
53  
54  	public long getSize() {
55  		return size;
56  	}
57  
58  	public void setSize(long objectSize) {
59  		this.size = objectSize;
60  	}
61  
62  	public String getPrefix() {
63  		return prefix;
64  	}
65  
66  	public void setPrefix(String prefix) {
67  		this.prefix = prefix;
68  	}
69  
70  	public Bucket getBucket() {
71  		return bucket;
72  	}
73  
74  	public void setBucket(Bucket bucket) {
75  		this.bucket = bucket;
76  	}
77  
78  }