Ejemplo n.º 1
0
 @Override
 public FileSystemPage makePage(
     File path, String pageName, FileSystemPage parent, VariableSource variableSource) {
   if (parent != null) {
     return new FileSystemPage(path, pageName, parent);
   } else {
     Maybe<String> rootPath = variableSource.findVariable("FITNESSE_ROOTPATH");
     return new FileSystemPage(
         path,
         pageName,
         versionsController,
         new FileSystemSubWikiPageFactory(new File(rootPath.getValue()), variableSource),
         variableSource);
   }
 }
 @Override
 public Maybe<String> findVariable(String name) {
   String value;
   if (variableSource != null) {
     if (name.equals("FITNESSE_PORT")) {
       Maybe<String> port = variableSource.findVariable("FITNESSE_PORT");
       value = port.isNothing() ? "-1" : port.getValue();
     } else if (name.equals("FITNESSE_ROOTPATH")) {
       Maybe<String> path = variableSource.findVariable("FITNESSE_ROOTPATH");
       value = path.isNothing() ? "" : path.getValue();
     } else if (name.equals("FITNESSE_VERSION")) {
       Maybe<String> version = variableSource.findVariable("FITNESSE_VERSION");
       value = version.isNothing() ? "" : version.getValue();
     } else {
       return Maybe.noString;
     }
     return new Maybe<String>(value);
   }
   return Maybe.noString;
 }