Statistics
| Branch: | Revision:

root / src / com / rackspace / cloud / files / api / client / ContainerObjects.java @ 038ac9a4

History | View | Annotate | Download (2.5 kB)

1 3d6041e8 Phillip Toohill
package com.rackspace.cloud.files.api.client;
2 3d6041e8 Phillip Toohill
3 1fd17f2e koutsoub
import java.util.Map;
4 1fd17f2e koutsoub
5 3d6041e8 Phillip Toohill
import com.rackspace.cloud.servers.api.client.Entity;
6 3d6041e8 Phillip Toohill
7 3d6041e8 Phillip Toohill
/**
8 3d6041e8 Phillip Toohill
 * @author Phillip Toohill dead2hill@gmail.com
9 038ac9a4 koutsoub
 * 
10 3d6041e8 Phillip Toohill
 */
11 3d6041e8 Phillip Toohill
public class ContainerObjects extends Entity {
12 3d6041e8 Phillip Toohill
13 3d6041e8 Phillip Toohill
        private static final long serialVersionUID = 5994739895998309675L;
14 3d6041e8 Phillip Toohill
        private String object;
15 3d6041e8 Phillip Toohill
        private String hash;
16 3d6041e8 Phillip Toohill
        private String lastMod;
17 6864568a Phillip Toohill
        private int bytes;
18 3d6041e8 Phillip Toohill
        private String cname;
19 3d6041e8 Phillip Toohill
        private String contentType;
20 038ac9a4 koutsoub
21 038ac9a4 koutsoub
        private boolean isFolder() {
22 71c27c5a koutsoub
                return contentType.startsWith("application/folder;");
23 71c27c5a koutsoub
        }
24 038ac9a4 koutsoub
25 3d6041e8 Phillip Toohill
        /**
26 3d6041e8 Phillip Toohill
         * 
27 3d6041e8 Phillip Toohill
         * @return the object
28 3d6041e8 Phillip Toohill
         */
29 3d6041e8 Phillip Toohill
        public String getObject() {
30 3d6041e8 Phillip Toohill
                return object;
31 3d6041e8 Phillip Toohill
        }
32 038ac9a4 koutsoub
33 3d6041e8 Phillip Toohill
        /**
34 3d6041e8 Phillip Toohill
         * 
35 038ac9a4 koutsoub
         * @param object
36 038ac9a4 koutsoub
         *            from container
37 3d6041e8 Phillip Toohill
         */
38 038ac9a4 koutsoub
        public void setObject(String object) {
39 3d6041e8 Phillip Toohill
                this.object = object;
40 3d6041e8 Phillip Toohill
        }
41 038ac9a4 koutsoub
42 3d6041e8 Phillip Toohill
        /**
43 3d6041e8 Phillip Toohill
         * @return the hash
44 3d6041e8 Phillip Toohill
         */
45 3d6041e8 Phillip Toohill
        public String getHash() {
46 3d6041e8 Phillip Toohill
                return hash;
47 3d6041e8 Phillip Toohill
        }
48 038ac9a4 koutsoub
49 3d6041e8 Phillip Toohill
        /**
50 038ac9a4 koutsoub
         * @param hash
51 038ac9a4 koutsoub
         *            hash of object
52 3d6041e8 Phillip Toohill
         */
53 3d6041e8 Phillip Toohill
        public void setHash(String hash) {
54 3d6041e8 Phillip Toohill
                this.hash = hash;
55 3d6041e8 Phillip Toohill
        }
56 038ac9a4 koutsoub
57 3d6041e8 Phillip Toohill
        /**
58 3d6041e8 Phillip Toohill
         * 
59 3d6041e8 Phillip Toohill
         * @return the LastMod ification of file
60 3d6041e8 Phillip Toohill
         */
61 3d6041e8 Phillip Toohill
        public String getLastMod() {
62 3d6041e8 Phillip Toohill
                return lastMod;
63 3d6041e8 Phillip Toohill
        }
64 038ac9a4 koutsoub
65 3d6041e8 Phillip Toohill
        /**
66 3d6041e8 Phillip Toohill
         * 
67 038ac9a4 koutsoub
         * @param lastMod
68 038ac9a4 koutsoub
         *            that LastMod is set to
69 3d6041e8 Phillip Toohill
         */
70 3d6041e8 Phillip Toohill
        public void setLastMod(String lastMod) {
71 3d6041e8 Phillip Toohill
                this.lastMod = lastMod;
72 3d6041e8 Phillip Toohill
        }
73 038ac9a4 koutsoub
74 3d6041e8 Phillip Toohill
        /**
75 3d6041e8 Phillip Toohill
         * 
76 3d6041e8 Phillip Toohill
         * @return the object's name
77 038ac9a4 koutsoub
         */
78 3d6041e8 Phillip Toohill
        public String getCName() {
79 3d6041e8 Phillip Toohill
                return cname;
80 3d6041e8 Phillip Toohill
        }
81 038ac9a4 koutsoub
82 3d6041e8 Phillip Toohill
        /**
83 3d6041e8 Phillip Toohill
         * 
84 038ac9a4 koutsoub
         * @param name
85 038ac9a4 koutsoub
         *            the object is set to
86 3d6041e8 Phillip Toohill
         */
87 3d6041e8 Phillip Toohill
        public void setCName(String cname) {
88 3d6041e8 Phillip Toohill
                this.cname = cname;
89 3d6041e8 Phillip Toohill
        }
90 038ac9a4 koutsoub
91 6864568a Phillip Toohill
        /**
92 6864568a Phillip Toohill
         * 
93 6864568a Phillip Toohill
         * @return the objects size
94 6864568a Phillip Toohill
         */
95 6864568a Phillip Toohill
        public int getBytes() {
96 3d6041e8 Phillip Toohill
                return bytes;
97 3d6041e8 Phillip Toohill
        }
98 038ac9a4 koutsoub
99 3d6041e8 Phillip Toohill
        /**
100 3d6041e8 Phillip Toohill
         * 
101 038ac9a4 koutsoub
         * @param the
102 038ac9a4 koutsoub
         *            bytes the object is set to
103 3d6041e8 Phillip Toohill
         */
104 6864568a Phillip Toohill
        public void setBytes(int bytes) {
105 3d6041e8 Phillip Toohill
                this.bytes = bytes;
106 3d6041e8 Phillip Toohill
        }
107 038ac9a4 koutsoub
108 6864568a Phillip Toohill
        /**
109 6864568a Phillip Toohill
         * 
110 038ac9a4 koutsoub
         * @param contentType
111 038ac9a4 koutsoub
         *            the object is set to
112 6864568a Phillip Toohill
         */
113 3d6041e8 Phillip Toohill
        public void setContentType(String contentType) {
114 3d6041e8 Phillip Toohill
                this.contentType = contentType;
115 038ac9a4 koutsoub
116 3d6041e8 Phillip Toohill
        }
117 038ac9a4 koutsoub
118 6864568a Phillip Toohill
        /**
119 6864568a Phillip Toohill
         * 
120 6864568a Phillip Toohill
         * @return the objects content type
121 6864568a Phillip Toohill
         */
122 038ac9a4 koutsoub
        public String getContentType() {
123 3d6041e8 Phillip Toohill
                return contentType;
124 3d6041e8 Phillip Toohill
        }
125 038ac9a4 koutsoub
126 1fd17f2e koutsoub
        @Override
127 1fd17f2e koutsoub
        public String toString() {
128 038ac9a4 koutsoub
                return "ContainerObjects [" + "getCName()=" + getCName() + " object="
129 038ac9a4 koutsoub
                                + object + ", hash=" + hash + ", lastMod=" + lastMod
130 038ac9a4 koutsoub
                                + ", bytes=" + bytes + ", cname=" + cname + ", contentType="
131 038ac9a4 koutsoub
                                + contentType + ", getId()=" + getId() + ", getName()="
132 038ac9a4 koutsoub
                                + getName() + ", getModifiedBy()=" + getModifiedBy()
133 038ac9a4 koutsoub
                                + ", getVersion()=" + getVersion() + ", getVersionTimestamp()="
134 038ac9a4 koutsoub
                                + getVersionTimestamp() + ", getObjectUUID()="
135 038ac9a4 koutsoub
                                + getObjectUUID() + ", getObjectHash()=" + getObjectHash()
136 038ac9a4 koutsoub
                                + ", getObjectSharing()=" + getObjectSharing()
137 038ac9a4 koutsoub
                                + ", getMetadata()=" + getMetadata() + "]";
138 1fd17f2e koutsoub
        }
139 3d6041e8 Phillip Toohill
140 038ac9a4 koutsoub
}