Package fitnesse.wiki.fs

Source Code of fitnesse.wiki.fs.InMemoryPage

// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.wiki.fs;

import java.io.File;
import java.util.Properties;

import fitnesse.wiki.SystemVariableSource;
import fitnesse.wiki.WikiPage;
import fitnesse.wiki.WikiPageFactory;

// In memory page, used for testing and instant pages (like GitFileVersionController's RecentChanges page).
public class InMemoryPage {

  public static WikiPage makeRoot(String name) {
    return makeRoot(name, null, new MemoryFileSystem());
  }

  public static WikiPage makeRoot(String name, MemoryFileSystem fileSystem) {
    return makeRoot(name, null, fileSystem);
  }

  public static WikiPage makeRoot(String name, Properties properties) {
    return makeRoot(name, properties, new MemoryFileSystem());
  }

  public static WikiPage makeRoot(String name, Properties properties, MemoryFileSystem fileSystem) {
    WikiPageFactory factory = new FileSystemPageFactory(fileSystem, new MemoryVersionsController(fileSystem), new SystemVariableSource(properties));
    FileSystemPage page = (FileSystemPage) factory.makePage(new File("."), name, null);
    return page;
  }
}
TOP

Related Classes of fitnesse.wiki.fs.InMemoryPage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.