001: /*
002: * This file is part of DrFTPD, Distributed FTP Daemon.
003: *
004: * DrFTPD is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * DrFTPD is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: *
014: * You should have received a copy of the GNU General Public License
015: * along with DrFTPD; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018: package org.drftpd.remotefile;
019:
020: import net.sf.drftpd.FileExistsException;
021: import net.sf.drftpd.NoAvailableSlaveException;
022: import net.sf.drftpd.ObjectNotFoundException;
023: import net.sf.drftpd.master.BaseFtpConnection;
024:
025: import java.io.FileNotFoundException;
026: import java.io.IOException;
027:
028: import java.util.Collection;
029: import java.util.List;
030: import java.util.Map;
031:
032: import org.drftpd.SFVFile;
033: import org.drftpd.master.RemoteSlave;
034: import org.drftpd.remotefile.LinkedRemoteFile.NonExistingFile;
035:
036: /**
037: * Abstract class for overriding only a subset of LinkedRemoteFile's methods.
038: * Can be used for testing.
039: * @author mog
040: * @version $Id: AbstractLinkedRemoteFile.java 944 2005-02-03 02:36:48Z mog $
041: */
042: public abstract class AbstractLinkedRemoteFile implements
043: LinkedRemoteFileInterface {
044: public AbstractLinkedRemoteFile() {
045: super ();
046: }
047:
048: public LinkedRemoteFile addFile(RemoteFileInterface file) {
049: throw new UnsupportedOperationException();
050: }
051:
052: public void addSlave(RemoteSlave slave) {
053: throw new UnsupportedOperationException();
054: }
055:
056: public int compareTo(Object o) {
057: throw new UnsupportedOperationException();
058: }
059:
060: public LinkedRemoteFile createDirectories(String path) {
061: throw new UnsupportedOperationException();
062: }
063:
064: public LinkedRemoteFile createDirectory(String fileName)
065: throws FileExistsException {
066: throw new UnsupportedOperationException();
067: }
068:
069: public LinkedRemoteFile createDirectory(String owner, String group,
070: String fileName) throws FileExistsException {
071: throw new UnsupportedOperationException();
072: }
073:
074: public void delete() {
075: throw new UnsupportedOperationException();
076: }
077:
078: public void deleteFromSlave(RemoteSlave slave) {
079: throw new UnsupportedOperationException();
080: }
081:
082: public void deleteOthers(RemoteSlave slave) {
083: throw new UnsupportedOperationException();
084: }
085:
086: public long dirSize() {
087: throw new UnsupportedOperationException();
088: }
089:
090: public RemoteSlave getASlave(char direction, BaseFtpConnection conn)
091: throws NoAvailableSlaveException {
092: throw new UnsupportedOperationException();
093: }
094:
095: public RemoteSlave getASlaveForDownload(BaseFtpConnection conn)
096: throws NoAvailableSlaveException {
097: throw new UnsupportedOperationException();
098: }
099:
100: public Collection getAvailableSlaves()
101: throws NoAvailableSlaveException {
102: throw new UnsupportedOperationException();
103: }
104:
105: public long getCheckSum() throws NoAvailableSlaveException {
106: throw new UnsupportedOperationException();
107: }
108:
109: public long getCheckSumCached() {
110: throw new UnsupportedOperationException();
111: }
112:
113: public long getCheckSumFromSlave()
114: throws NoAvailableSlaveException, IOException {
115: throw new UnsupportedOperationException();
116: }
117:
118: public Collection getDirectories() {
119: throw new UnsupportedOperationException();
120: }
121:
122: public LinkedRemoteFileInterface getFile(String fileName)
123: throws FileNotFoundException {
124: throw new UnsupportedOperationException();
125: }
126:
127: public LinkedRemoteFileInterface getFileDeleted(String fileName)
128: throws FileNotFoundException {
129: throw new UnsupportedOperationException();
130: }
131:
132: public List getFiles2() {
133: throw new UnsupportedOperationException();
134: }
135:
136: public List getFiles() {
137: return getFiles2();
138: }
139:
140: public String getGroupname() {
141: throw new UnsupportedOperationException();
142: }
143:
144: public RemoteFileInterface getLink() throws FileNotFoundException {
145: throw new UnsupportedOperationException();
146: }
147:
148: public String getLinkPath() {
149: throw new UnsupportedOperationException();
150: }
151:
152: public Map getMap() {
153: throw new UnsupportedOperationException();
154: }
155:
156: public String getName() {
157: throw new UnsupportedOperationException();
158: }
159:
160: public LinkedRemoteFileInterface getOldestFile()
161: throws ObjectNotFoundException {
162: throw new UnsupportedOperationException();
163: }
164:
165: public String getParent() throws FileNotFoundException {
166: throw new UnsupportedOperationException();
167: }
168:
169: public LinkedRemoteFile getParentFile()
170: throws FileNotFoundException {
171: throw new UnsupportedOperationException();
172: }
173:
174: public LinkedRemoteFile getParentFileNull() {
175: throw new UnsupportedOperationException();
176: }
177:
178: public String getPath() {
179: throw new UnsupportedOperationException();
180: }
181:
182: public LinkedRemoteFile getRoot() {
183: throw new UnsupportedOperationException();
184: }
185:
186: public SFVFile getSFVFile() throws IOException,
187: FileNotFoundException, NoAvailableSlaveException {
188: throw new UnsupportedOperationException();
189: }
190:
191: public Collection getSlaves() {
192: throw new UnsupportedOperationException();
193: }
194:
195: public String getUsername() {
196: throw new UnsupportedOperationException();
197: }
198:
199: public long getXferspeed() {
200: throw new UnsupportedOperationException();
201: }
202:
203: public long getXfertime() {
204: throw new UnsupportedOperationException();
205: }
206:
207: public boolean hasFile(String filename) {
208: throw new UnsupportedOperationException();
209: }
210:
211: public boolean hasOfflineSlaves() {
212: throw new UnsupportedOperationException();
213: }
214:
215: public boolean hasSlave(RemoteSlave slave) {
216: throw new UnsupportedOperationException();
217: }
218:
219: public boolean isAvailable() {
220: throw new UnsupportedOperationException();
221: }
222:
223: public boolean isDeleted() {
224: throw new UnsupportedOperationException();
225: }
226:
227: public boolean isDirectory() {
228: throw new UnsupportedOperationException();
229: }
230:
231: public boolean isFile() {
232: throw new UnsupportedOperationException();
233: }
234:
235: public boolean isLink() {
236: throw new UnsupportedOperationException();
237: }
238:
239: public boolean isValid() {
240: return true;
241: }
242:
243: public long lastModified() {
244: throw new UnsupportedOperationException();
245: }
246:
247: public long length() {
248: throw new UnsupportedOperationException();
249: }
250:
251: public RemoteFileInterface[] listFiles() {
252: throw new UnsupportedOperationException();
253: }
254:
255: public LinkedRemoteFile lookupFile(String path)
256: throws FileNotFoundException {
257: throw new UnsupportedOperationException();
258: }
259:
260: public LinkedRemoteFile lookupFile(String path,
261: boolean includeDeleted) throws FileNotFoundException {
262: throw new UnsupportedOperationException();
263: }
264:
265: public NonExistingFile lookupNonExistingFile(String path) {
266: throw new UnsupportedOperationException();
267: }
268:
269: public NonExistingFile lookupNonExistingFile(String path,
270: boolean includeDeleted) {
271: throw new UnsupportedOperationException();
272: }
273:
274: public String lookupPath(String path) {
275: throw new UnsupportedOperationException();
276: }
277:
278: public SFVFile lookupSFVFile() throws IOException,
279: FileNotFoundException, NoAvailableSlaveException {
280: throw new UnsupportedOperationException();
281: }
282:
283: public LinkedRemoteFile putFile(RemoteFileInterface file) {
284: throw new UnsupportedOperationException();
285: }
286:
287: public void remerge(LinkedRemoteFile mergedir, RemoteSlave rslave) {
288: throw new UnsupportedOperationException();
289: }
290:
291: public boolean removeSlave(RemoteSlave slave) {
292: throw new UnsupportedOperationException();
293: }
294:
295: public void renameTo(String toDirPath, String toName)
296: throws IOException, FileNotFoundException {
297: throw new UnsupportedOperationException();
298: }
299:
300: public void setCheckSum(long checkSum) {
301: throw new UnsupportedOperationException();
302: }
303:
304: public void setGroup(String group) {
305: throw new UnsupportedOperationException();
306: }
307:
308: public void setLastModified(long lastModified) {
309: throw new UnsupportedOperationException();
310: }
311:
312: public void setLength(long length) {
313: throw new UnsupportedOperationException();
314: }
315:
316: public void setOwner(String owner) {
317: throw new UnsupportedOperationException();
318: }
319:
320: public void setXfertime(long xfertime) {
321: throw new UnsupportedOperationException();
322: }
323:
324: public void unmergeDir(RemoteSlave rslave) {
325: throw new UnsupportedOperationException();
326: }
327:
328: public void unmergeFile(RemoteSlave rslave) {
329: throw new UnsupportedOperationException();
330: }
331:
332: public void cleanSlaveFromMerging(RemoteSlave slave) {
333: throw new UnsupportedOperationException();
334: }
335:
336: public void resetSlaveForMerging(RemoteSlave slave) {
337: throw new UnsupportedOperationException();
338: }
339:
340: public void setSlaveForMerging(RemoteSlave rslave) {
341: throw new UnsupportedOperationException();
342: }
343:
344: public List<LinkedRemoteFileInterface> getAllParentFiles() {
345: throw new UnsupportedOperationException();
346: }
347: }
|