Class FileSystemRepository

  extended by org.modeshape.graph.connector.base.Repository<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace>
      extended by org.modeshape.connector.filesystem.FileSystemRepository

public class FileSystemRepository
extends Repository<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace>

Implementation of Repository that provides access to an underlying file system. This repository only natively supports nodes of primary types nt:folder, nt:file, and mode:resource, although the CustomPropertiesFactory allows for the addition of mixin types to any and all primary types.

Field Summary
protected  FileSystemSource source
Fields inherited from class org.modeshape.graph.connector.base.Repository
context, rootNodeUuid
Constructor Summary
FileSystemRepository(FileSystemSource source)
Method Summary
 RequestProcessor createRequestProcessor(Transaction<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace> txn)
          Create a RequestProcessor instance that should be used to process a set of requests within the supplied transaction.
protected  File getWorkspaceDirectory(String workspaceName)
protected  void initialize()
          Creates any predefined workspaces, including the default workspace.
 org.modeshape.connector.filesystem.FileSystemRepository.FileSystemTransaction startTransaction(ExecutionContext context, boolean readonly)
          Begin a transaction, hinting whether the transaction will be used only to read the content.
Methods inherited from class org.modeshape.graph.connector.base.Repository
createWorkspace, destroyWorkspace, getContext, getDefaultWorkspaceName, getRootNodeUuid, getSourceName, getWorkspace, getWorkspaceNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected final FileSystemSource source
Constructor Detail


public FileSystemRepository(FileSystemSource source)
Method Detail


protected void initialize()
Creates any predefined workspaces, including the default workspace.

initialize in class Repository<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace>


protected File getWorkspaceDirectory(String workspaceName)
workspaceName - the name of the workspace for which the root directory should be returned
the directory that maps to the root node in the named workspace; may be null if the directory does not exist, is a file, or cannot be read.


public org.modeshape.connector.filesystem.FileSystemRepository.FileSystemTransaction startTransaction(ExecutionContext context,
                                                                                                      boolean readonly)
Description copied from class: Repository
Begin a transaction, hinting whether the transaction will be used only to read the content. If this is called, then the transaction must be either committed or rolled back.

Specified by:
startTransaction in class Repository<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace>
context - the context in which the transaction is to be performed; may not be null
readonly - true if the transaction will not modify any content, or false if changes are to be made
the transaction; never null
See Also:
Transaction.commit(), Transaction.rollback()


public RequestProcessor createRequestProcessor(Transaction<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace> txn)
Description copied from class: Repository
Create a RequestProcessor instance that should be used to process a set of requests within the supplied transaction.

createRequestProcessor in class Repository<PathNode,org.modeshape.connector.filesystem.FileSystemWorkspace>
txn - the transaction; may not be null
the request processor

Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.