1 18 package net.sf.drftpd.remotefile; 19 20 import java.io.FileNotFoundException ; 21 import java.io.IOException ; 22 import java.util.Collection ; 23 import java.util.Map ; 24 import java.util.Set ; 25 26 import net.sf.drftpd.FileExistsException; 27 import net.sf.drftpd.NoAvailableSlaveException; 28 import net.sf.drftpd.ObjectNotFoundException; 29 import net.sf.drftpd.SFVFile; 30 import net.sf.drftpd.master.RemoteSlave; 31 import net.sf.drftpd.remotefile.LinkedRemoteFile.NonExistingFile; 32 import net.sf.drftpd.slave.Transfer; 33 import net.sf.drftpd.slave.TransferStatus; 34 35 41 public interface LinkedRemoteFileInterface extends RemoteFileInterface { 42 45 public abstract LinkedRemoteFile addFile(AbstractRemoteFile file); 46 public abstract void addSlave(RemoteSlave slave); 47 51 public abstract int compareTo(Object o); 52 public abstract LinkedRemoteFile createDirectories(String path); 53 public abstract LinkedRemoteFile createDirectory(String fileName) 54 throws FileExistsException; 55 public abstract LinkedRemoteFile createDirectory( 56 String owner, 57 String group, 58 String fileName) 59 throws FileExistsException; 60 66 public abstract void delete(); 67 70 public abstract void deleteOthers(Set destSlaves); 71 public abstract long dirSize(); 72 public abstract Collection getAvailableSlaves() 73 throws NoAvailableSlaveException; 74 77 public abstract long getCheckSum() throws NoAvailableSlaveException; 78 81 public abstract long getCheckSumFromSlave() 82 throws NoAvailableSlaveException, IOException ; 83 public abstract Collection getDirectories(); 84 90 public abstract LinkedRemoteFileInterface getFile(String fileName) 91 throws FileNotFoundException ; 92 public abstract LinkedRemoteFileInterface getFileDeleted( 93 String fileName) 94 throws FileNotFoundException ; 95 96 103 public abstract Map getMap(); 104 public abstract LinkedRemoteFileInterface getOldestFile() 105 throws ObjectNotFoundException; 106 public abstract LinkedRemoteFile getParentFile() 107 throws FileNotFoundException ; 108 public abstract LinkedRemoteFile getParentFileNull(); 109 public abstract LinkedRemoteFile getRoot(); 110 public abstract SFVFile getSFVFile() 111 throws IOException , FileNotFoundException , NoAvailableSlaveException; 112 public abstract long getXferspeed(); 113 118 public abstract boolean hasFile(String filename); 119 public abstract int hashCode(); 120 124 public abstract boolean hasOfflineSlaves(); 125 public abstract boolean hasSlave(RemoteSlave slave); 126 131 public abstract boolean isAvailable(); 132 public abstract LinkedRemoteFile lookupFile(String path) 133 throws FileNotFoundException ; 134 public abstract LinkedRemoteFile lookupFile( 135 String path, 136 boolean includeDeleted) 137 throws FileNotFoundException ; 138 public abstract NonExistingFile lookupNonExistingFile(String path); 139 public abstract NonExistingFile lookupNonExistingFile( 140 String path, 141 boolean includeDeleted); 142 145 public abstract String lookupPath(String path); 146 public abstract SFVFile lookupSFVFile() 147 throws IOException , FileNotFoundException , NoAvailableSlaveException; 148 151 public abstract LinkedRemoteFile putFile(RemoteFileInterface file); 152 153 public TransferStatus receiveFile(Transfer transfer, char type, long offset) throws IOException ; 154 158 public abstract void remerge(LinkedRemoteFile mergedir, RemoteSlave rslave); 159 public abstract boolean removeSlave(RemoteSlave slave); 160 163 public abstract LinkedRemoteFile renameTo(String toDirPath, String toName) 164 throws IOException , FileNotFoundException ; 165 public TransferStatus sendFile(Transfer transfer, char type, long offset) throws IOException ; 166 public abstract void setCheckSum(long checkSum); 167 public abstract void setGroup(String group); 168 public abstract void setLastModified(long lastModified); 169 public abstract void setLength(long length); 170 public abstract void setOwner(String owner); 171 public abstract void setXfertime(long xfertime); 172 public abstract String toString(); 173 public abstract void unmergeDir(RemoteSlave rslave); 174 public abstract void unmergeFile(RemoteSlave rslave); 175 } | Popular Tags |