Automated merge with https://gss.googlecode.com/hg/
[pithos] / src / gr / ebs / gss / server / domain / dto / FolderDTO.java
1 /*
2  * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
3  *
4  * This file is part of GSS.
5  *
6  * GSS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 package gr.ebs.gss.server.domain.dto;
20
21 import java.io.Serializable;
22 import java.util.ArrayList;
23 import java.util.List;
24
25 /**
26  * @author chstath
27  */
28 public class FolderDTO implements Serializable {
29
30         /**
31          * The serial version UID.
32          */
33         private static final long serialVersionUID = 1L;
34
35         /**
36          * The persistence ID of the object.
37          */
38         private Long id;
39
40         /**
41          * The folder name.
42          */
43         private String name;
44
45         /**
46          * The folder path.
47          */
48         private String path;
49
50         /**
51          * The subfolders in this folder. A List so we can keep order.
52          *
53          *
54          */
55         private List<FolderDTO> subfolders = new ArrayList<FolderDTO>();
56
57         /**
58          * The owner of this folder.
59          */
60         private UserDTO owner;
61
62         /**
63          * The parent folder that contains this folder.
64          */
65         private FolderDTO parent;
66
67         /**
68          * The audit information for this object.
69          */
70         private AuditInfoDTO auditInfo;
71         /**
72          * Is this folder temporarily deleted?
73          */
74         private boolean deleted=false;
75
76         /**
77          * Anyone can read this folder?
78          */
79         private boolean readForAll=false;
80         
81         private Boolean shared=false;
82
83         /**
84          * @return the id
85          */
86         public Long getId() {
87                 return id;
88         }
89
90         /**
91          * @param newId the id to set
92          */
93         public void setId(final Long newId) {
94                 id = newId;
95         }
96
97         /**
98          * @return the name
99          */
100         public String getName() {
101                 return name;
102         }
103
104         /**
105          * @param newName the name to set
106          */
107         public void setName(final String newName) {
108                 name = newName;
109         }
110
111         /**
112          * @return the subfolders
113          */
114         public List<FolderDTO> getSubfolders() {
115                 return subfolders;
116         }
117
118         /**
119          * @param newSubfolders the subfolders to set
120          */
121         public void setSubfolders(final List<FolderDTO> newSubfolders) {
122                 subfolders = newSubfolders;
123         }
124
125         /**
126          * @return the owner
127          */
128         public UserDTO getOwner() {
129                 return owner;
130         }
131
132         /**
133          * @param newOwner the owner to set
134          */
135         public void setOwner(final UserDTO newOwner) {
136                 owner = newOwner;
137         }
138
139         /**
140          * Retrieve the parent.
141          *
142          * @return the parent
143          */
144         public FolderDTO getParent() {
145                 return parent;
146         }
147
148         /**
149          * Modify the parent.
150          *
151          * @param newParent the parent to set
152          */
153         public void setParent(final FolderDTO newParent) {
154                 parent = newParent;
155         }
156
157         /**
158          * Retrieve the auditInfo.
159          *
160          * @return the auditInfo
161          */
162         public AuditInfoDTO getAuditInfo() {
163                 return auditInfo;
164         }
165
166         /**
167          * Modify the auditInfo.
168          *
169          * @param newAuditInfo the auditInfo to set
170          */
171         public void setAuditInfo(final AuditInfoDTO newAuditInfo) {
172                 auditInfo = newAuditInfo;
173         }
174
175
176         /**
177          * Retrieve the deleted.
178          *
179          * @return the deleted
180          */
181         public boolean isDeleted() {
182                 return deleted;
183         }
184
185
186         /**
187          * Modify the deleted.
188          *
189          * @param newDeleted the deleted to set
190          */
191         public void setDeleted(boolean newDeleted) {
192                 deleted = newDeleted;
193         }
194
195
196         /**
197          * Retrieve the path.
198          *
199          * @return the path
200          */
201         public String getPath() {
202                 return path;
203         }
204
205
206         /**
207          * Modify the path.
208          *
209          * @param aPath the path to set
210          */
211         public void setPath(String aPath) {
212                 path = aPath;
213         }
214
215         /**
216          * Retrieve the URI for this resource, relative to the REST API root URI.
217          * This unique identifier can be used to refer to the resource from
218          * various GSS clients.
219          *
220          * @return the URI
221          */
222         public String getURI() {
223                 return owner.getUsername() + FileHeaderDTO.PATH_FILES + getPath();
224         }
225
226         /**
227          * Modify the readForAll.
228          *
229          * @param aReadForAll the readForAll to set
230          */
231         public void setReadForAll(boolean aReadForAll) {
232                 readForAll = aReadForAll;
233         }
234
235         /**
236          * Retrieve the readForAll.
237          *
238          * @return the readForAll
239          */
240         public boolean isReadForAll() {
241                 return readForAll;
242         }
243         
244         
245         /**
246          * Retrieve the shared.
247          *
248          * @return the shared
249          */
250         public Boolean getShared() {
251                 return shared;
252         }
253         
254         
255         /**
256          * Modify the shared.
257          *
258          * @param shared the shared to set
259          */
260         public void setShared(Boolean shared) {
261                 this.shared = shared;
262         }
263 }