crisp.wbwiki.server
Class WikiDbTextFile

java.lang.Object
  extended by crisp.wbwiki.server.WikiDbTextFile
All Implemented Interfaces:
WikiDb

public class WikiDbTextFile
extends Object
implements WikiDb

Implementation of WikiDb that stores to a text file.

Author:
Henrik Kniberg

Constructor Summary
WikiDbTextFile(File path)
           
 
Method Summary
 int getCurrentVersion()
           
 File getPath()
          Path to the file used to store wiki data.
 Page loadPage()
          Never null.
 int savePage(String pageContent)
          Saves the page and increments the version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiDbTextFile

public WikiDbTextFile(File path)
Parameters:
path - Path to the file used to store wiki data (required).
Method Detail

getPath

public File getPath()
Path to the file used to store wiki data. Never null.


loadPage

public Page loadPage()
Description copied from interface: WikiDb
Never null. May be empty though.

Specified by:
loadPage in interface WikiDb

savePage

public int savePage(String pageContent)
Saves the page and increments the version.

Specified by:
savePage in interface WikiDb
Parameters:
pageContent -
Returns:
the new version

getCurrentVersion

public int getCurrentVersion()
Specified by:
getCurrentVersion in interface WikiDb


Copyright © 2006. All Rights Reserved.