|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.impl.AbstractFileSystemBuilder<T>
org.entityfs.impl.impl.AbstractFileSystemBuilderImpl<JarFileSystemBuilder>
org.entityfs.jar.JarFileSystemBuilder
public class JarFileSystemBuilder
This is a builder class for building read only Jar file-backed file systems.
A limitation of the Jar file system is that it must be built upon a Jar file
in a file-backed file system. This is because Java's JarFile
class
only can be built from a File
object.
The Jar file system must be closed when it is not needed anymore. If a file entity is used for the jar file, it is locked for reading by the Jar file system. The lock is released when the file system is closed.
Field Summary |
---|
Fields inherited from interface org.entityfs.FileSystemBuilder |
---|
DEFAULT_BUFFER_SIZE |
Constructor Summary | |
---|---|
JarFileSystemBuilder()
Create a builder with default settings: LogAdapter : DefaultLogAdapter.DEFAULT_ADAPTER
EntityValidityControlStrategy : null (no one else
should have write access to the backend)
|
Method Summary | |
---|---|
protected AdapterFactory |
createAdapterFactory()
Subclasses implement this to create the right AdapterFactory
implementation. |
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. |
JarFileSystemBuilder |
setJarFile(EFile f)
Set the Jar file. |
JarFileSystemBuilder |
setJarFile(File f)
Set the Jar file. |
JarFileSystemBuilder |
setJarFile(JarFile f)
Set the Jar file. |
protected Collection<String> |
validate()
Validate that we can create a file system with the current properties. |
Methods inherited from class org.entityfs.impl.impl.AbstractFileSystemBuilderImpl |
---|
create, createDefaultChildEntityManagerFactory, enableEvents, getChildEntityManagerFactory, getEventManager, isFileSystemSupportedByAllCapabilities, setChildEntityManagerFactory, setEventManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JarFileSystemBuilder()
LogAdapter
: DefaultLogAdapter.DEFAULT_ADAPTER
EntityValidityControlStrategy
: null
(no one else
should have write access to the backend)
Method Detail |
---|
public JarFileSystemBuilder setJarFile(File f)
f
- The Jar file.
this
.public JarFileSystemBuilder setJarFile(EFile f) throws IllegalArgumentException
f
- The Jar file.
this
.
IllegalArgumentException
- If the file is not in a file-backed file
system.public JarFileSystemBuilder setJarFile(JarFile f)
f
- The Jar file.
this
.public boolean isLockingSupported()
FileSystemBuilder
false
.FileSystemBuilder.enableLocking()
protected Collection<String> validate()
AbstractFileSystemBuilder
super.validate()
).
validate
in class AbstractFileSystemBuilder<JarFileSystemBuilder>
Collection
of error messages. Can be empty but never
null
.protected boolean isReadOnly()
AbstractFileSystemBuilderImpl
This method is called from AbstractFileSystemBuilderImpl.create()
.
isReadOnly
in class AbstractFileSystemBuilderImpl<JarFileSystemBuilder>
true
, always.protected AdapterFactory createAdapterFactory()
AbstractFileSystemBuilderImpl
AdapterFactory
implementation.
This method is called from AbstractFileSystemBuilderImpl.create()
.
createAdapterFactory
in class AbstractFileSystemBuilderImpl<JarFileSystemBuilder>
AdapterFactory
implementation.protected FileSystemDelegate createFileSystemDelegate(FileSystemAdapter fsa)
AbstractFileSystemBuilderImpl
This method is called from AbstractFileSystemBuilderImpl.create()
.
createFileSystemDelegate
in class AbstractFileSystemBuilderImpl<JarFileSystemBuilder>
fsa
- The file system adapter.
protected FileSystemImplementation createFileSystem(SupportObjects fso, FileSystemDelegate fsd)
AbstractFileSystemBuilderImpl
This method is called from AbstractFileSystemBuilderImpl.create()
.
createFileSystem
in class AbstractFileSystemBuilderImpl<JarFileSystemBuilder>
fso
- A collection of support objects.fsd
- The file system delegate.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |