|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.schmant.support.entityfs.SchmantFileSystems
public final class SchmantFileSystems
This is Schmant's wrapper for the EntityFS FileSystems
utility class.
The methods in this class calls their FileSystems
counterparts and
sets the SchmantReportLogAdapter
LogAdapter
on the returned (entities') file systems.
Method Summary | |
---|---|
static Directory |
createRamFileSystem()
Create a memory-backed locking file system and return its root directory. |
static Directory |
getEntityForDirectory(File d,
boolean readOnly)
Creates a locking file system with the root in the supplied directory and returns the root directory. |
static Directory |
getEntityForDirectory(File d,
boolean readOnly,
boolean locking)
Creates a file system with the root in the supplied directory and returns the root directory. |
static Directory |
getEntityForDirectory(File d,
String tmpDirName)
Creates a read/write locking file system with the root in the supplied directory and returns the root directory. |
static EFile |
getEntityForFile(File f,
boolean readOnly)
Create a locking file system with the root directory in the file's parent directory and return a reference to the file entity. |
static File |
makeFileBacked(EFile f)
Make the supplied file entity File -backed. |
static EFile |
makeRandomlyAccessible(EFile f)
Make sure that the file is randomly accessible (supports the FCRandomAccess capability). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Directory getEntityForDirectory(File d, boolean readOnly)
File system locking is a way of ensuring that parallel threads cannot
modify the same entities simultaneously. If you're running a
single-threaded build, you can create a non-locking file system using
the getEntityForDirectory(File, boolean, boolean)
method
instead.
The returned file system logs to a SchmantReportLogAdapter
.
This is equivalent to calling:
new FS(RO/RW)FileSystemBuilder().
setRoot(d).
( enableLocking(). if read/write)
disableEntityValidityControls().
disableAccessControls().
setLogAdapter(SchmantReportLogAdapter.INSTANCE).
create().
getRootDirectory();
d
- The directory.readOnly
- Should the returned directory be read only?
getEntityForDirectory(File, String)
,
getEntityForDirectory(File, boolean, boolean)
public static Directory getEntityForDirectory(File d, boolean readOnly, boolean locking)
locking
to true
.
File system locking is a way of ensuring that parallel threads cannot modify the same entities simultaneously.
The returned file system logs to a SchmantReportLogAdapter
.
This is equivalent to calling:
new FS(RO/RW)FileSystemBuilder().
setRoot(d).
( enableLocking(). if read/write and locking is enabled)
disableEntityValidityControls().
disableAccessControls().
setLogAdapter(SchmantReportLogAdapter.INSTANCE).
create().
getRootDirectory();
d
- The directory.readOnly
- Should the returned directory be read only?locking
- Should the returned file system be locking (if it is
read/write)?
getEntityForDirectory(File, String)
,
getEntityForDirectory(File, boolean)
public static Directory getEntityForDirectory(File d, String tmpDirName)
The file system is assigned a temporary directory with the name tmpDirName
in its root directory. If the directory does not already
exist, it is created.
d
- The directorytmpDirName
- The name of the file system's temporary files
directory, in the file system's root directory. If the directory does not
already exist, it is created by this method.
getEntityForDirectory(File, boolean)
public static EFile getEntityForFile(File f, boolean readOnly)
The file system is created with the same settings as a file system
created by getEntityForDirectory(File, boolean)
.
f
- The file.readOnly
- Should the returned file be read only?
public static Directory createRamFileSystem()
The returned file system logs to a SchmantReportLogAdapter
.
This is equivalent to calling:
new RamFileSystemBuilder().
enableLocking().
disableEntityValidityControls().
setLogAdapter(SchmantReportLogAdapter.INSTANCE).
create().
getRootDirectory();
public static File makeFileBacked(EFile f) throws WrappedIOException
File
-backed. If the entity is in
a non-file backed file system, it is copied to a temporary directory.
f
- The entity to make file-backed.
WrappedIOException
public static EFile makeRandomlyAccessible(EFile f)
FCRandomAccess
capability). If it is not,
its contents is copied to a temporary file and the temporary file is
returned.
f
- The file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |