org.jpublish.repository.filesystem
Class FileSystemRepository

java.lang.Object
  |
  +--org.jpublish.repository.AbstractRepository
        |
        +--org.jpublish.repository.filesystem.FileSystemRepository
All Implemented Interfaces:
Configurable, Repository

public class FileSystemRepository
extends AbstractRepository
implements Configurable

An implementation of the Repository interface which pulls content from the local file system.

Author:
Anthony Eden

Fields inherited from class org.jpublish.repository.AbstractRepository
siteContext
 
Constructor Summary
FileSystemRepository()
           
 
Method Summary
 java.lang.String get(java.lang.String path)
          Get the content from the given path.
 java.lang.String get(java.lang.String path, org.apache.velocity.VelocityContext context)
          Get the content from the given path and merge it with the given context.
 long getLastModified(java.lang.String path)
          Get the last modified time in milliseconds for the given path.
 java.lang.String getName()
          Get the name of the repository.
 java.lang.String getRoot()
          Get the root directory for locating content.
 void loadConfiguration(org.jdom.Element element)
          Load the repository's configuration from the given JDOM element.
 void setRoot(java.lang.String root)
          Set the root directory for locating content.
 
Methods inherited from class org.jpublish.repository.AbstractRepository
setSiteContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemRepository

public FileSystemRepository()
Method Detail

get

public java.lang.String get(java.lang.String path)
                     throws java.lang.Exception
Get the content from the given path. Implementations of this method should NOT merge the content using Velocity.
Parameters:
path - The relative content path
Returns:
The content as a String
Throws:
java.lang.Exception - Any Exception

get

public java.lang.String get(java.lang.String path,
                            org.apache.velocity.VelocityContext context)
                     throws java.lang.Exception
Get the content from the given path and merge it with the given context.
Parameters:
path - The content path
context - The VelocityContext
Returns:
The content as a String
Throws:
java.lang.Exception - Any Exception

getName

public java.lang.String getName()
Get the name of the repository. This name is used to expose the Repository in the Velocity engine.
Returns:
The Repository name

getLastModified

public long getLastModified(java.lang.String path)
                     throws java.lang.Exception
Get the last modified time in milliseconds for the given path.
Parameters:
path - The content path
Returns:
The last modified time in milliseconds
Throws:
java.lang.Exception - Any Exception

getRoot

public java.lang.String getRoot()
Get the root directory for locating content.
Returns:
The root directory

setRoot

public void setRoot(java.lang.String root)
Set the root directory for locating content.
Parameters:
root - The new root directory

loadConfiguration

public void loadConfiguration(org.jdom.Element element)
                       throws java.lang.Exception
Load the repository's configuration from the given JDOM element.
Specified by:
loadConfiguration in interface Configurable
Parameters:
element - The JDOM element
Throws:
java.lang.Exception -  


Copyright (C) 2001 Anthony Eden. All Rights Reserved.