Beispiel #1
0
 public List<String> list(String suffix) throws IOException {
   String directory = locator.root(suffix);
   if (directory == null || directory.length() == 0) {
     directory = "/";
   }
   List<String> list = doList(directory, suffix);
   if (list == null || list.size() == 0) {
     return new ArrayList<String>(0);
   } else {
     List<String> result = new ArrayList<String>(list.size());
     for (String name : list) {
       if (name != null && name.length() > 0) {
         result.add(UrlUtils.cleanName(name));
       }
     }
     return result;
   }
 }
Beispiel #2
0
 public List<String> doList(String directory, String suffix) throws IOException {
   File file = new File(directory);
   return UrlUtils.listFile(file, suffix);
 }