1 5 package SOFA.SOFAnode.TR.Impl; 6 7 import java.io.File ; 8 import java.io.Serializable ; 9 import java.util.Hashtable ; 10 11 15 class ComponentFiles implements Serializable { 16 17 23 private Hashtable files; 24 25 28 ComponentFiles () { 29 files = new Hashtable (); 30 } 31 32 38 void addFiles (String path, String name) { 39 File file = new File (path); 40 if (file.isDirectory()) { if (!path.endsWith(File.separator)) 42 path = path + File.separator; 43 if (!name.endsWith(File.separator)) 44 name = name + File.separator; 45 String [] subFiles = file.list(); 46 for (int i = 0; i < subFiles.length; i++) { 47 String subFile = subFiles[i]; 48 addFiles(path + subFile, name + subFile); 49 } 50 } else 51 files.put(name, file); } 53 54 59 void addFile (File file, String name) { 60 assert(file.isDirectory()); 61 files.put(name, file); } 63 64 69 Hashtable getFiles () { 70 return files; 71 } 72 73 78 File getAssemblyDescriptorFile () { 79 return (File ) files.get(File.separator + "index.dc"); 80 } 81 } 82 | Popular Tags |