Package org.apache.wiki.providers
Class FileSystemProvider
- java.lang.Object
-
- org.apache.wiki.providers.AbstractFileProvider
-
- org.apache.wiki.providers.FileSystemProvider
-
- All Implemented Interfaces:
PageProvider
,WikiProvider
public class FileSystemProvider extends AbstractFileProvider
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
-
Nested classes/interfaces inherited from class org.apache.wiki.providers.AbstractFileProvider
AbstractFileProvider.WikiFileFilter
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_EXT
All metadata is stored in a file with this extension.-
Fields inherited from class org.apache.wiki.providers.AbstractFileProvider
DEFAULT_ENCODING, DEFAULT_MAX_PROPKEYLENGTH, DEFAULT_MAX_PROPLIMIT, DEFAULT_MAX_PROPVALUELENGTH, FILE_EXT, m_encoding, m_engine, MAX_PROPKEYLENGTH, MAX_PROPLIMIT, MAX_PROPVALUELENGTH, PROP_CUSTOMPROP_MAXKEYLENGTH, PROP_CUSTOMPROP_MAXLIMIT, PROP_CUSTOMPROP_MAXVALUELENGTH, PROP_PAGEDIR
-
Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION
-
-
Constructor Summary
Constructors Constructor Description FileSystemProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deletePage(java.lang.String pageName)
Removes an entire page from the repository.Page
getPageInfo(java.lang.String page, int version)
Always returns the latest version, since FileSystemProvider does not support versioning.void
movePage(java.lang.String from, java.lang.String to)
Move a pagevoid
putPageText(Page page, java.lang.String text)
Attempts to save the page text for page "page".-
Methods inherited from class org.apache.wiki.providers.AbstractFileProvider
addCustomProperties, deleteVersion, findPage, findPages, getAllChangedSince, getAllPages, getCustomProperties, getPageCount, getPageText, getProviderInfo, getVersionHistory, initialize, mangleName, pageExists, pageExists, setCustomProperties, unmangleName, validateCustomPageProperties
-
-
-
-
Field Detail
-
PROP_EXT
public static final java.lang.String PROP_EXT
All metadata is stored in a file with this extension.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileSystemProvider
public FileSystemProvider()
-
-
Method Detail
-
putPageText
public void putPageText(Page page, java.lang.String text) throws ProviderException
Attempts to save the page text for page "page". Note that the provider creates a new version regardless of what the version parameter of the WikiPage is.- Specified by:
putPageText
in interfacePageProvider
- Overrides:
putPageText
in classAbstractFileProvider
- Parameters:
page
- The WikiPage to savetext
- The text to save.- Throws:
ProviderException
- If something goes wrong.
-
getPageInfo
public Page getPageInfo(java.lang.String page, int version) throws ProviderException
Always returns the latest version, since FileSystemProvider does not support versioning. Returns info about the page.- Specified by:
getPageInfo
in interfacePageProvider
- Overrides:
getPageInfo
in classAbstractFileProvider
- Parameters:
page
- The page nameversion
- The version number- Returns:
- A filled WikiPage.
- Throws:
ProviderException
- If something goes wrong.
-
deletePage
public void deletePage(java.lang.String pageName) throws ProviderException
Removes an entire page from the repository. The implementations should really do no more security checks, since that is the domain of the PageManager. Just delete it as efficiently as you can. You should also delete any auxiliary files that belong to this page, IF they were created by this provider.The 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...
- Specified by:
deletePage
in interfacePageProvider
- Overrides:
deletePage
in classAbstractFileProvider
- Parameters:
pageName
- Name of the page to be removed completely.- Throws:
ProviderException
- If the page could not be removed for some reason.
-
movePage
public void movePage(java.lang.String from, java.lang.String to) throws ProviderException
Move a page- Parameters:
from
- Name of the page to move.to
- New name of the page.- Throws:
ProviderException
- If the page could not be moved for some reason.
-
-