1 21 22 package org.armedbear.j; 23 24 public final class DirectoryTreeElement 25 { 26 private File file; 27 28 public DirectoryTreeElement(File file) 29 { 30 this.file = file; 31 } 32 33 public File getFile() 34 { 35 return file; 36 } 37 38 public String getPath() 39 { 40 return file.canonicalPath(); 41 } 42 43 public String toString() 44 { 45 if (file.canonicalPath().equals("/")) { 46 if (file.isRemote()) 47 return file.getHostName(); 48 return "/"; 50 } 51 String s = file.getName(); 52 if (s != null && s.length() > 0) 53 return s; 54 return file.netPath(); 56 } 57 58 public String getStatusText() 59 { 60 return null; 61 } 62 } 63 | Popular Tags |