001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: */package org.jamwiki.model;
017:
018: import java.sql.Timestamp;
019: import org.jamwiki.utils.WikiLogger;
020:
021: /**
022: * Provides an object representing a file uploaded to the Wiki.
023: */
024: public class WikiFile {
025:
026: // FIXME - consider making this an ACL (more flexible)
027: private boolean adminOnly = false;
028: private Timestamp deleteDate = null;
029: private int fileId = -1;
030: private String fileName = null;
031: private long fileSize = -1;
032: private String mimeType = null;
033: private boolean readOnly = false;
034: private String url = null;
035: private int topicId = -1;
036: private String virtualWiki = null;
037: private static final WikiLogger logger = WikiLogger
038: .getLogger(WikiFile.class.getName());
039:
040: /**
041: *
042: */
043: public WikiFile() {
044: }
045:
046: /**
047: *
048: */
049: public WikiFile(WikiFile wikiFile) {
050: this .adminOnly = wikiFile.getAdminOnly();
051: this .deleteDate = wikiFile.getDeleteDate();
052: this .fileId = wikiFile.getFileId();
053: this .fileName = wikiFile.getFileName();
054: this .fileSize = wikiFile.getFileSize();
055: this .mimeType = wikiFile.getMimeType();
056: this .readOnly = wikiFile.getReadOnly();
057: this .url = wikiFile.getUrl();
058: this .topicId = wikiFile.getTopicId();
059: this .virtualWiki = wikiFile.getVirtualWiki();
060: }
061:
062: /**
063: *
064: */
065: public boolean getAdminOnly() {
066: return this .adminOnly;
067: }
068:
069: /**
070: *
071: */
072: public void setAdminOnly(boolean adminOnly) {
073: this .adminOnly = adminOnly;
074: }
075:
076: /**
077: *
078: */
079: public Timestamp getDeleteDate() {
080: return this .deleteDate;
081: }
082:
083: /**
084: *
085: */
086: public void setDeleteDate(Timestamp deleteDate) {
087: this .deleteDate = deleteDate;
088: }
089:
090: /**
091: *
092: */
093: public int getFileId() {
094: return this .fileId;
095: }
096:
097: /**
098: *
099: */
100: public void setFileId(int fileId) {
101: this .fileId = fileId;
102: }
103:
104: /**
105: *
106: */
107: public String getFileName() {
108: return this .fileName;
109: }
110:
111: /**
112: *
113: */
114: public void setFileName(String fileName) {
115: this .fileName = fileName;
116: }
117:
118: /**
119: *
120: */
121: public long getFileSize() {
122: return this .fileSize;
123: }
124:
125: /**
126: *
127: */
128: public void setFileSize(long fileSize) {
129: this .fileSize = fileSize;
130: }
131:
132: /**
133: *
134: */
135: public String getMimeType() {
136: return this .mimeType;
137: }
138:
139: /**
140: *
141: */
142: public void setMimeType(String mimeType) {
143: this .mimeType = mimeType;
144: }
145:
146: /**
147: *
148: */
149: public boolean getReadOnly() {
150: return this .readOnly;
151: }
152:
153: /**
154: *
155: */
156: public void setReadOnly(boolean readOnly) {
157: this .readOnly = readOnly;
158: }
159:
160: /**
161: *
162: */
163: public int getTopicId() {
164: return this .topicId;
165: }
166:
167: /**
168: *
169: */
170: public void setTopicId(int topicId) {
171: this .topicId = topicId;
172: }
173:
174: /**
175: *
176: */
177: public String getUrl() {
178: return this .url;
179: }
180:
181: /**
182: *
183: */
184: public void setUrl(String url) {
185: this .url = url;
186: }
187:
188: /**
189: *
190: */
191: public String getVirtualWiki() {
192: return this .virtualWiki;
193: }
194:
195: /**
196: *
197: */
198: public void setVirtualWiki(String virtualWiki) {
199: this.virtualWiki = virtualWiki;
200: }
201: }
|