KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > applications > sharedfolder > model > FolderInfo


1 /*
2  * Lucane - a collaborative platform
3  * Copyright (C) 2005 Vincent Fiack <vfiack@mail15.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package org.lucane.applications.sharedfolder.model;
21
22 import java.util.Date JavaDoc;
23
24 public class FolderInfo implements SharedItem
25 {
26     public static final int ROOT_ID = -1;
27     public static final int NEW_ID = -2;
28
29     private int id;
30     private int parentId;
31     private String JavaDoc name;
32     private String JavaDoc owner;
33     private Date JavaDoc created;
34     private Date JavaDoc modified;
35     private boolean readable;
36     private boolean writable;
37
38     public FolderInfo(int id, int parentId, String JavaDoc folderName, String JavaDoc owner, Date JavaDoc created, Date JavaDoc modified,
39                       boolean readable, boolean writable)
40     {
41         this.id = id;
42         this.parentId = parentId;
43         this.name = folderName;
44         this.owner = owner;
45         this.created = created;
46         this.modified = modified;
47         this.readable = readable;
48         this.writable = writable;
49     }
50
51     public FolderInfo(int parentId, String JavaDoc folderName, String JavaDoc owner)
52     {
53         this(NEW_ID, parentId, folderName, owner, null, null, true, true);
54     }
55
56     public boolean isFolder()
57     {
58         return true;
59     }
60
61     public int getId()
62     {
63         return id;
64     }
65
66     public void setParentId(int id)
67     {
68         this.parentId = id;
69     }
70
71     public int getParentId()
72     {
73         return parentId;
74     }
75
76     public void setName(String JavaDoc name)
77     {
78         this.name = name;
79     }
80
81     public String JavaDoc getName()
82     {
83         return name;
84     }
85
86     public String JavaDoc getOwner()
87     {
88         return owner;
89     }
90
91     public Date JavaDoc getCreationDate()
92     {
93         return created;
94     }
95
96     public Date JavaDoc getLastModified()
97     {
98         return modified;
99     }
100
101     public long getSize()
102     {
103         return 0;
104     }
105
106     public boolean isReadable()
107     {
108         return readable;
109     }
110
111     public boolean isWritable()
112     {
113         return writable;
114     }
115
116     public String JavaDoc toString()
117     {
118         return "" + parentId + "/" + name + " (" + owner + ", " + created + ":" + modified + ")";
119     }
120 }
Popular Tags