|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.core.FileManager
| Field Summary | |
|---|---|
java.lang.String |
CONFIG_PATH
The Path, where Configuration Files Should be stored |
static FileManager |
DEFAULT_FILE_MANAGER
The default FileManager instance |
java.lang.String |
EXT_PATH
The Path, where Extensions for this Application should be stored |
java.lang.String |
ROOT_PATH
The Root-Path of the Application´s Ressources |
java.lang.String |
TEMP_PATH
The Path, where Temporary Files Should be stored |
| Constructor Summary | |
|---|---|
protected |
FileManager()
Constructs a new FileManager instance, tries to create the different paths if they don't exist and adds the EXT_PATH to the java.ext.dirs and java.library.path system properties. |
| Method Summary | |
|---|---|
static java.lang.String |
convertPath(java.lang.String path)
Converts a given path with Unix slashes "/" to the system dependend path |
private static FileManager |
createDefault()
Create the default FileManager instance |
java.lang.String |
getConfigPath(java.lang.String path)
Get an absolute path from a given String containing the relative path to the CONFIG directory. |
static FileManager |
getDefault()
Get the default File Manager. |
static java.lang.String |
getExtension(java.io.File f)
Extracts the extension (e.g. |
static java.lang.String |
getNameWithoutExtension(java.io.File f)
Get the name of a file without its extension. |
static java.io.File |
getParallelFile(java.io.File source,
java.lang.String extension)
Returns a File object with the name of the source file with an added additional extension |
java.lang.String |
getRootPath(java.lang.String path)
Get an absolute path from a given String containing the relative path to the ROOT directory. |
java.lang.String[] |
listDirsRoot(java.lang.String directory)
List all directories in a directory relative to the ROOT directory |
static java.nio.MappedByteBuffer |
mapByteContent(java.io.File f)
Maps a whole file into memory in Read-Only mode |
static java.nio.MappedByteBuffer |
mapByteContent(java.io.File f,
java.nio.channels.FileChannel.MapMode mapMode)
Maps a whole file into memory in the given MapMode |
static java.nio.MappedByteBuffer |
mapByteContent(java.io.File f,
long position,
long length)
Maps part of a file into memory in Read-Only mode |
static java.nio.MappedByteBuffer |
mapByteContent(java.io.File f,
long position,
long length,
java.nio.channels.FileChannel.MapMode mapMode)
Maps part of a file into memory in the given MapMode |
protected abstract void |
setErrorHandler()
Set the default error handler This method will be called from within the Constructor and can be overridden by subclasses to set another error |
protected abstract java.lang.String |
tellConfigPath()
Tell the Config path of an application under which the configuration files should be stored. |
protected abstract java.lang.String |
tellExtPath()
Tell the Extension path of an application under which the extension files lie. |
protected abstract java.lang.String |
tellRootPath()
Tell the Root path of an application under which the ressource files lie. |
protected abstract java.lang.String |
tellTempPath()
Tell the Temporary path under which temp files should be stored. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String CONFIG_PATH
public static final FileManager DEFAULT_FILE_MANAGER
public final java.lang.String EXT_PATH
public final java.lang.String ROOT_PATH
public final java.lang.String TEMP_PATH
| Constructor Detail |
|---|
protected FileManager()
| Method Detail |
|---|
public static java.lang.String convertPath(java.lang.String path)
path - The path using Unix slashes "/"
private static FileManager createDefault()
public java.lang.String getConfigPath(java.lang.String path)
path - The relative path to the CONFIG directory.
The Unix Slash "/" should be used as path separator
(will be replaced with the system dependend separator.
File-Instance for the wanted file.public static FileManager getDefault()
public static java.lang.String getExtension(java.io.File f)
f - The file
public static java.lang.String getNameWithoutExtension(java.io.File f)
f - The file
public static java.io.File getParallelFile(java.io.File source,
java.lang.String extension)
source - The source Fileextension - Extension without "." that should be
added to the source file´s name
public java.lang.String getRootPath(java.lang.String path)
path - The relative path to the ROOT directory.
The Unix Slash "/" should be used as path separator
(will be replaced with the system dependend separator.
public java.lang.String[] listDirsRoot(java.lang.String directory)
directory - relative path to the directory
The Unix Slash "/" should be used as path separator
(will be replaced with the system dependend separator.
public static java.nio.MappedByteBuffer mapByteContent(java.io.File f)
throws java.io.IOException
f - The file to be mapped
java.io.IOException - If an I/O-Error occurs
public static java.nio.MappedByteBuffer mapByteContent(java.io.File f,
java.nio.channels.FileChannel.MapMode mapMode)
throws java.io.IOException
f - The file to be mappedmapMode - The MapMode in which the file should be mapped
java.io.IOException - If an I/O-Error occurs
public static java.nio.MappedByteBuffer mapByteContent(java.io.File f,
long position,
long length)
throws java.io.IOException
f - The file to be mappedposition - Offset in bytes from the beginning of the filelength - Length in bytes of the region to be mapped
java.io.IOException - If an I/O-Error occurs
public static java.nio.MappedByteBuffer mapByteContent(java.io.File f,
long position,
long length,
java.nio.channels.FileChannel.MapMode mapMode)
throws java.io.IOException
f - The file to be mappedposition - Offset in bytes from the beginning of the filelength - Length in bytes of the region to be mappedmapMode - The MapMode in which the file should be mapped
java.io.IOException - If an I/O-Error occursprotected abstract void setErrorHandler()
protected abstract java.lang.String tellConfigPath()
protected abstract java.lang.String tellExtPath()
null to indicate that this
FileManager doesn't support an extension dir.protected abstract java.lang.String tellRootPath()
protected abstract java.lang.String tellTempPath()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||