public static List<String> getFileList(File dir, String file_pattern) {
    ArrayList<String> file_names = new ArrayList<String>();
    String[] path_elements = file_pattern.split("/");

    if (path_elements[0].equals(".")) {
      String next_file_pattern = construct_path_string(path_elements);
      file_names.addAll(getFileList(dir, next_file_pattern));
    } else if (path_elements[0].equals("..")) {// traverse up one directory
      String next_file_pattern = construct_path_string(path_elements);
      file_names.addAll(getFileList(dir.getParentFile(), next_file_pattern));
    } else {
      
      GlobFilenameFilter filter = new GlobFilenameFilter(path_elements[0]);
      File[] files = dir.listFiles((FilenameFilter) filter);
      for (File f : files) {
        
        if (path_elements.length > 1) {// traverse sub directories
          if (f.exists() && f.isDirectory()) {
            String next_file_pattern = construct_path_string(path_elements);
            file_names.addAll(getFileList(f, next_file_pattern));
          }
        } else {
          if (f.exists()) {
            file_names.add(f.getAbsolutePath());
          }
        }
      }
    }
    return file_names;
  }