org.modeshape.connector.filesystem
Class FileSystemRepository

java.lang.Object
  extended by org.modeshape.graph.connector.path.PathRepository
      extended by org.modeshape.graph.connector.path.WritablePathRepository
          extended by org.modeshape.connector.filesystem.FileSystemRepository

public class FileSystemRepository
extends WritablePathRepository

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


Nested Class Summary
 class FileSystemRepository.FileSystemWorkspace
          Writable workspace implementation for file system-backed workspaces
 
Field Summary
protected  FileSystemSource source
           
 
Fields inherited from class org.modeshape.graph.connector.path.PathRepository
rootNodeUuid, workspaces
 
Constructor Summary
FileSystemRepository(FileSystemSource source)
           
 
Method Summary
protected  WritablePathWorkspace createWorkspace(ExecutionContext context, String name)
          Creates a new workspace with the given name containing only a root node.
 WorkspaceCache getCache(String workspaceName)
           
protected  File getWorkspaceDirectory(String workspaceName)
           
protected  void initialize()
          Creates any predefined workspaces, including the default workspace.
 
Methods inherited from class org.modeshape.graph.connector.path.WritablePathRepository
createWorkspace, createWorkspace, destroyWorkspace, isWritable
 
Methods inherited from class org.modeshape.graph.connector.path.PathRepository
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

source

protected final FileSystemSource source
Constructor Detail

FileSystemRepository

public FileSystemRepository(FileSystemSource source)
Method Detail

initialize

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

Specified by:
initialize in class PathRepository

getCache

public WorkspaceCache getCache(String workspaceName)

createWorkspace

protected WritablePathWorkspace createWorkspace(ExecutionContext context,
                                                String name)
Description copied from class: WritablePathRepository
Creates a new workspace with the given name containing only a root node.

This method does NOT automatically add the newly created workspace to the workspace map or check to see if a workspace already exists in this repository with the same name.

Specified by:
createWorkspace in class WritablePathRepository
Parameters:
context - the context in which the workspace is to be created
name - the name of the workspace
Returns:
the newly created workspace; may not be null

getWorkspaceDirectory

protected File getWorkspaceDirectory(String workspaceName)
Parameters:
workspaceName - the name of the workspace for which the root directory should be returned
Returns:
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.


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