145 name = cleanPath(new File(name)); 146 if ( name != null && name.length() > 0 && !inputSet.contains(name) ) { 147 inputSet.add(name); 148 } 149 } 150 151 // Expand file/directory input so we get a complete set (except ordered) 152 // Should be everything not excluded and not in order list. 153 Set<String> allFilesIncluded = expand(null, inputSet, processed); 154 155 // Create simple sorted list so we can add ordered items at end. 156 List<String> allFiles = new ArrayList<String>(allFilesIncluded); 157 Collections.sort(allFiles); 158 159 // Now add the ordered set to the end of the list. 160 // Add in REVERSE ORDER, so that the first element is closest to 161 // the end (and the index). 162 for (int i = orderList.size() - 1; i >= 0; --i) { 163 String s = orderList.get(i); 164 if (allFilesExcluded.contains(s)) { 165 System.err.println("Included order file " + s 166 + " is also excluded, skipping."); 167 } else if (new File(s).exists()) { 168 allFiles.add(s); 169 } else { 170 System.err.println("Included order file " + s 171 + " missing, skipping."); 172 } 173 } 174 175 // Print final results. 176 for (String str : allFiles) { 177 out.println(str); 178 } 179 out.flush(); 180 out.close(); 181 } 182 183 /* 184 * Read a file containing a list of files and directories into a List. 185 */ 186 private List<String> readListFromFile(String fileName, | 145 name = cleanPath(new File(name)); 146 if ( name != null && name.length() > 0 && !inputSet.contains(name) ) { 147 inputSet.add(name); 148 } 149 } 150 151 // Expand file/directory input so we get a complete set (except ordered) 152 // Should be everything not excluded and not in order list. 153 Set<String> allFilesIncluded = expand(null, inputSet, processed); 154 155 // Create simple sorted list so we can add ordered items at end. 156 List<String> allFiles = new ArrayList<String>(allFilesIncluded); 157 Collections.sort(allFiles); 158 159 // Now add the ordered set to the end of the list. 160 // Add in REVERSE ORDER, so that the first element is closest to 161 // the end (and the index). 162 for (int i = orderList.size() - 1; i >= 0; --i) { 163 String s = orderList.get(i); 164 if (allFilesExcluded.contains(s)) { 165 // Disable this warning until 8005688 is fixed 166 // System.err.println("Included order file " + s 167 // + " is also excluded, skipping."); 168 } else if (new File(s).exists()) { 169 allFiles.add(s); 170 } else { 171 System.err.println("Included order file " + s 172 + " missing, skipping."); 173 } 174 } 175 176 // Print final results. 177 for (String str : allFiles) { 178 out.println(str); 179 } 180 out.flush(); 181 out.close(); 182 } 183 184 /* 185 * Read a file containing a list of files and directories into a List. 186 */ 187 private List<String> readListFromFile(String fileName, |