1 18 package net.sf.drftpd.remotefile; 19 20 24 public abstract class AbstractRemoteFile implements RemoteFileInterface { 25 public boolean equals(Object file) { 26 if (!(file instanceof RemoteFileInterface)) 27 return false; 28 return getPath().equals(((AbstractRemoteFile) file).getPath()); 29 } 30 31 public String getGroupname() { 32 return "drftpd"; 33 } 34 35 public RemoteFileInterface getLink() { 36 throw new UnsupportedOperationException (); 37 } 38 39 public String getUsername() { 40 return "drftpd"; 41 } 42 43 public long getXfertime() { 44 throw new UnsupportedOperationException (); 45 } 46 47 public boolean isDeleted() { 48 return false; 49 } 50 51 public int hashCode() { 52 return getName().hashCode(); 53 } 54 55 public boolean isLink() { 56 return false; 57 } 58 59 public String toString() { 60 StringBuffer ret = new StringBuffer (); 61 ret.append(getClass().getName()+"["); 62 if (isDirectory()) 63 ret.append("[directory: true]"); 64 if(isFile()) 65 ret.append("[file: true]"); 66 ret.append("[length(): "+this.length()+"]"); 67 ret.append(getPath()); 68 ret.append("]"); 69 return ret.toString(); 70 } 71 72 public String getLinkPath() { 73 return getLink().getPath(); 74 } 75 76 public long getCheckSumCached() { 77 return 0; 78 } 79 } 80 | Popular Tags |