KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > drftpd > remotefile > RemoteFileInterface


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

18 package net.sf.drftpd.remotefile;
19
20 import java.io.FileNotFoundException JavaDoc;
21 import java.util.Collection JavaDoc;
22
23 /**
24  * @author mog
25  * @version $Id: RemoteFileInterface.java,v 1.10 2004/03/26 11:22:21 mog Exp $
26  */

27 public interface RemoteFileInterface {
28     /**
29      * Returns the cached checksum or 0 if no checksum was cached.
30      * <p>
31      * Use {getCheckSum()} to automatically calculate checksum if no cached checksum is available.
32      */

33     public long getCheckSumCached();
34     /**
35      * Returns a Collection of RemteFileInterface objects.
36      */

37     public Collection JavaDoc getFiles();
38
39     /**
40      * Get the group owner of the file as a String.
41      * <p>
42      * getUser().getGroupname() if the implementing class uses a User object.
43      * @return primary group of the owner of this file
44      */

45     public String JavaDoc getGroupname();
46     
47     /**
48      * Returns the target of the link.
49      * @return target of the link.
50      * @see #isLink()
51      */

52     public RemoteFileInterface getLink() throws FileNotFoundException JavaDoc;
53
54     public String JavaDoc getLinkPath();
55
56     /**
57      * @see java.io.File#getName()
58      */

59     public String JavaDoc getName();
60     
61     public abstract String JavaDoc getParent() throws FileNotFoundException JavaDoc;
62
63     public abstract String JavaDoc getPath();
64
65     public Collection JavaDoc getSlaves();
66     /**
67      * Returns string representation of the owner of this file.
68      * <p>
69      * getUser().getUsername() if the implementing class uses a User object.
70      * @return username of the owner of this file.
71      */

72     public String JavaDoc getUsername();
73     public long getXfertime();
74     
75     /**
76      * <p>
77      * A flag indicating whether this file is queued for deletion.
78      * <p>
79      * A file will be queued for deletion when a slave was unable to delete the file, most likely because it was offline at the time of deletion. Deleted will be retried when the slave filelist is merged with the master.
80      * @return true if the file is deleted.
81      */

82     public boolean isDeleted();
83     
84     /**
85      * @see java.io.File#isDirectory()
86      */

87     public boolean isDirectory();
88     
89     /**
90      * @see java.io.File#isFile()
91      */

92     public boolean isFile();
93     
94     /**
95      * boolean flag whether this file is a 'link', it can be linked to another file.
96      * This is for the moment used for "ghost files".
97      */

98     public boolean isLink();
99     
100     /**
101      * @see java.io.File#lastModified()
102      */

103     public long lastModified();
104     
105     /**
106      * @see java.io.File#length()
107      */

108     public long length();
109 }
110
Popular Tags