001: /*
002: * Lucane - a collaborative platform
003: * Copyright (C) 2005 Vincent Fiack <vfiack@mail15.com>
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019:
020: package org.lucane.applications.sharedfolder.model;
021:
022: import java.util.Date;
023:
024: public class FolderInfo implements SharedItem {
025: public static final int ROOT_ID = -1;
026: public static final int NEW_ID = -2;
027:
028: private int id;
029: private int parentId;
030: private String name;
031: private String owner;
032: private Date created;
033: private Date modified;
034: private boolean readable;
035: private boolean writable;
036:
037: public FolderInfo(int id, int parentId, String folderName,
038: String owner, Date created, Date modified,
039: boolean readable, boolean writable) {
040: this .id = id;
041: this .parentId = parentId;
042: this .name = folderName;
043: this .owner = owner;
044: this .created = created;
045: this .modified = modified;
046: this .readable = readable;
047: this .writable = writable;
048: }
049:
050: public FolderInfo(int parentId, String folderName, String owner) {
051: this (NEW_ID, parentId, folderName, owner, null, null, true,
052: true);
053: }
054:
055: public boolean isFolder() {
056: return true;
057: }
058:
059: public int getId() {
060: return id;
061: }
062:
063: public void setParentId(int id) {
064: this .parentId = id;
065: }
066:
067: public int getParentId() {
068: return parentId;
069: }
070:
071: public void setName(String name) {
072: this .name = name;
073: }
074:
075: public String getName() {
076: return name;
077: }
078:
079: public String getOwner() {
080: return owner;
081: }
082:
083: public Date getCreationDate() {
084: return created;
085: }
086:
087: public Date getLastModified() {
088: return modified;
089: }
090:
091: public long getSize() {
092: return 0;
093: }
094:
095: public boolean isReadable() {
096: return readable;
097: }
098:
099: public boolean isWritable() {
100: return writable;
101: }
102:
103: public String toString() {
104: return "" + parentId + "/" + name + " (" + owner + ", "
105: + created + ":" + modified + ")";
106: }
107: }
|