org.entityfs.fs
Class FSRWFileSystemBuilder

java.lang.Object
  extended by org.entityfs.impl.AbstractFileSystemBuilder<T>
      extended by org.entityfs.impl.impl.AbstractFileSystemBuilderImpl<T>
          extended by org.entityfs.fs.AbstractFSFileSystemBuilder<FSRWFileSystemBuilder>
              extended by org.entityfs.fs.FSRWFileSystemBuilder
All Implemented Interfaces:
FileSystemBuilder<FSRWFileSystemBuilder>, FSFileSystemBuilder<FSRWFileSystemBuilder>

public class FSRWFileSystemBuilder
extends AbstractFSFileSystemBuilder<FSRWFileSystemBuilder>
implements FileSystemBuilder<FSRWFileSystemBuilder>

This is a builder object for read/write, file-backed file systems.

By default, this builder creates a file system with a minimal set of features. Use the setter methods of this object to enable features.

Since:
1.0
Author:
Karl Gustafsson
See Also:
FSROFileSystemBuilder
In_jar:
entityfs-fsfs

Field Summary
 
Fields inherited from interface org.entityfs.FileSystemBuilder
DEFAULT_BUFFER_SIZE
 
Constructor Summary
FSRWFileSystemBuilder()
          Create a builder with default settings: LogAdapter: DefaultLogAdapter.DEFAULT_ADAPTER EntityValidityControlStrategy: BackendCheckingValidityControlStrategy
 
Method Summary
protected  FileSystemImplementation createFileSystem(SupportObjects fso, FileSystemDelegate fsd)
          Subclasses implement this to return a new file system instance.
protected  FileSystemDelegate createFileSystemDelegate(FileSystemAdapter fsa)
          This method is implemented by a subclass to create the file system delegate to use.
 boolean isLockingSupported()
          Does the file system being built support locking?
protected  boolean isReadOnly()
          Subclasses implement this method to tell if the file system they are about to create is read only.
protected  Collection<String> validate()
          Override the inherited method to add more validation.
 
Methods inherited from class org.entityfs.fs.AbstractFSFileSystemBuilder
createAdapterFactory, getRoot, setRoot
 
Methods inherited from class org.entityfs.impl.impl.AbstractFileSystemBuilderImpl
create, createDefaultChildEntityManagerFactory, enableEvents, getChildEntityManagerFactory, getEventManager, isFileSystemSupportedByAllCapabilities, setChildEntityManagerFactory, setEventManager
 
Methods inherited from class org.entityfs.impl.AbstractFileSystemBuilder
addCapabilityProvider, addCapabilityProviders, disableAccessControls, disableEntityValidityControls, enableLocking, getAccessController, getBufferSize, getCapabilityProviders, getCapabilityProvidersInternal, getEntityValidityControlStrategy, getLockAcquiringStrategy, getLockAdapterFactory, getLockCommandExecutor, getLogAdapter, getName, getThis, setAccessController, setBufferSize, setEntityValidityControlStrategy, setLockAcquiringStrategy, setLockAdapterFactory, setLockCommandExecutor, setLogAdapter, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.entityfs.FileSystemBuilder
addCapabilityProvider, addCapabilityProviders, create, disableAccessControls, disableEntityValidityControls, enableEvents, enableLocking, getAccessController, getBufferSize, getCapabilityProviders, getEntityValidityControlStrategy, getLockAcquiringStrategy, getLockAdapterFactory, getLogAdapter, getName, setAccessController, setBufferSize, setEntityValidityControlStrategy, setLockAcquiringStrategy, setLockAdapterFactory, setLogAdapter, setName
 

Constructor Detail

FSRWFileSystemBuilder

public FSRWFileSystemBuilder()
Create a builder with default settings:

Method Detail

createFileSystemDelegate

protected FileSystemDelegate createFileSystemDelegate(FileSystemAdapter fsa)
Description copied from class: AbstractFileSystemBuilderImpl
This method is implemented by a subclass to create the file system delegate to use.

This method is called from AbstractFileSystemBuilderImpl.create().

Specified by:
createFileSystemDelegate in class AbstractFileSystemBuilderImpl<FSRWFileSystemBuilder>
Parameters:
fsa - The file system adapter.
Returns:
A file system delegate.

createFileSystem

protected FileSystemImplementation createFileSystem(SupportObjects fso,
                                                    FileSystemDelegate fsd)
Description copied from class: AbstractFileSystemBuilderImpl
Subclasses implement this to return a new file system instance. The returned instance does not have any root directory set (yet).

This method is called from AbstractFileSystemBuilderImpl.create().

Specified by:
createFileSystem in class AbstractFileSystemBuilderImpl<FSRWFileSystemBuilder>
Parameters:
fso - A collection of support objects.
fsd - The file system delegate.
Returns:
A file system implementation.

validate

protected Collection<String> validate()
Override the inherited method to add more validation.

Overrides:
validate in class AbstractFSFileSystemBuilder<FSRWFileSystemBuilder>
Returns:
A Collection of error messages. Can be empty but never null.

isLockingSupported

public boolean isLockingSupported()
Description copied from interface: FileSystemBuilder
Does the file system being built support locking?

Specified by:
isLockingSupported in interface FileSystemBuilder<FSRWFileSystemBuilder>
Returns:
true.
See Also:
FileSystemBuilder.enableLocking()

isReadOnly

protected boolean isReadOnly()
Description copied from class: AbstractFileSystemBuilderImpl
Subclasses implement this method to tell if the file system they are about to create is read only.

This method is called from AbstractFileSystemBuilderImpl.create().

Specified by:
isReadOnly in class AbstractFileSystemBuilderImpl<FSRWFileSystemBuilder>
Returns:
false, always.