Code example for File

Methods: getName, isDirectory, list

0
      if (isValidFile(file))
        pageDirectoryMap.put(file.getName(), file);
  } 
 
  private boolean isValidFile(File file) {
    return file.isDirectory() && file.list().length > 0 && WikiWordPath.isWikiWord(file.getName());
  } 
 
  public Set<String> getPageNames() {
    return new TreeSet<String>(pageDirectoryMap.keySet());
  } 
 
  public PageHistory getPageHistory(String pageName) {
    File pageHistoryDirectory = pageDirectoryMap.get(pageName);
    if (pageHistoryDirectory == null)
      return null; 
    else { 
      PageHistory pageHistory = new PageHistory(pageHistoryDirectory);
      if (pageHistory.size() == 0)
        return null; 
      else