|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ecyrd.jspwiki.providers.FileSystemProvider
Provides a simple directory based repository for Wiki pages.
All files have ".txt" appended to make life easier for those who insist on using Windows or other software which makes assumptions on the files contents based on its name.
| Nested Class Summary | |
class |
FileSystemProvider.SearchResultImpl
Searches return this class. |
class |
FileSystemProvider.WikiFileFilter
|
| Field Summary | |
static java.lang.String |
FILE_EXT
All files should have this extension to be recognized as JSPWiki files. |
protected java.lang.String |
m_encoding
|
static java.lang.String |
PROP_PAGEDIR
Name of the property that defines where page directories are. |
| Fields inherited from interface com.ecyrd.jspwiki.WikiProvider |
LATEST_VERSION |
| Constructor Summary | |
FileSystemProvider()
|
|
| Method Summary | |
void |
deletePage(java.lang.String pageName)
Removes an entire page from the repository. |
void |
deleteVersion(java.lang.String pageName,
int version)
Removes a specific version from the repository. |
protected java.io.File |
findPage(java.lang.String page)
Finds a Wiki page from the page repository. |
java.util.Collection |
findPages(QueryItem[] query)
Finds pages based on the query. |
java.util.Collection |
getAllChangedSince(java.util.Date date)
Gets a list of recent changes. |
java.util.Collection |
getAllPages()
Returns all pages. |
int |
getPageCount()
Gets the number of pages. |
WikiPage |
getPageInfo(java.lang.String page,
int version)
Always returns the latest version, since FileSystemProvider does not support versioning. |
java.lang.String |
getPageText(java.lang.String page,
int version)
This implementation just returns the current version, as filesystem does not provide versioning information for now. |
java.lang.String |
getProviderInfo()
Return a valid HTML string for information. |
java.util.List |
getVersionHistory(java.lang.String page)
The FileSystemProvider provides only one version. |
void |
initialize(java.util.Properties properties)
Initializes the page provider. |
protected java.lang.String |
mangleName(java.lang.String pagename)
This makes sure that the queried page name is still readable by the file system. |
boolean |
pageExists(java.lang.String page)
Return true, if page exists. |
void |
putPageText(WikiPage page,
java.lang.String text)
Attempts to save the page text for page "page". |
protected java.lang.String |
unmangleName(java.lang.String filename)
This makes the reverse of mangleName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String m_encoding
public static final java.lang.String PROP_PAGEDIR
public static final java.lang.String FILE_EXT
| Constructor Detail |
public FileSystemProvider()
| Method Detail |
public void initialize(java.util.Properties properties)
throws NoRequiredPropertyException,
java.io.IOException
WikiProvider
initialize in interface WikiProviderjava.io.FileNotFoundException - If the specified page directory does not exist.
java.io.IOException - In case the specified page directory is a file, not a directory.
NoRequiredPropertyExceptionprotected java.lang.String mangleName(java.lang.String pagename)
protected java.lang.String unmangleName(java.lang.String filename)
protected java.io.File findPage(java.lang.String page)
public boolean pageExists(java.lang.String page)
WikiPageProvider
pageExists in interface WikiPageProvider
public java.lang.String getPageText(java.lang.String page,
int version)
throws ProviderException
getPageText in interface WikiPageProviderpage - Name of the page to fetch.version - Version of the page to fetch.
ProviderException
public void putPageText(WikiPage page,
java.lang.String text)
WikiPageProvider
putPageText in interface WikiPageProvider
public java.util.Collection getAllPages()
throws ProviderException
WikiPageProvider
getAllPages in interface WikiPageProviderProviderExceptionpublic java.util.Collection getAllChangedSince(java.util.Date date)
WikiPageProvider
getAllChangedSince in interface WikiPageProviderpublic int getPageCount()
WikiPageProvider
getPageCount in interface WikiPageProviderpublic java.util.Collection findPages(QueryItem[] query)
WikiPageProvider
findPages in interface WikiPageProvider
public WikiPage getPageInfo(java.lang.String page,
int version)
throws ProviderException
getPageInfo in interface WikiPageProviderProviderException
public java.util.List getVersionHistory(java.lang.String page)
throws ProviderException
getVersionHistory in interface WikiPageProviderProviderExceptionpublic java.lang.String getProviderInfo()
WikiProvider
getProviderInfo in interface WikiProvider
public void deleteVersion(java.lang.String pageName,
int version)
WikiPageProvider
deleteVersion in interface WikiPageProviderpageName - Name of the page to be removed.version - Version of the page to be removed. May be LATEST_VERSION.public void deletePage(java.lang.String pageName)
WikiPageProviderThe reason why this is named differently from deleteVersion() (logically, this method should be an overloaded version) is that I want to be absolutely sure I don't accidentally use the wrong method. With overloading something like that happens sometimes...
deletePage in interface WikiPageProviderpageName - Name of the page to be removed completely.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||