com.myJava.file.driver
Interface FileSystemDriver

All Known Subinterfaces:
LinkableFileSystemDriver
All Known Implementing Classes:
AbstractFileSystemDriver, AbstractLinkableFileSystemDriver, AbstractRemoteFileSystemDriver, CachedFileSystemDriver, CompressedFileSystemDriver, DefaultFileSystemDriver, EncryptedFileSystemDriver, EventFileSystemDriver, FTPFileSystemDriver, HashFileSystemDriver

public interface FileSystemDriver

This interface defines a file access layer.
It mimics the File class methods.

Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Field Summary
static short ACCESS_EFFICIENCY_AVERAGE
           
static short ACCESS_EFFICIENCY_GOOD
           
static short ACCESS_EFFICIENCY_POOR
           
 
Method Summary
 void applyMetaData(FileMetaData p, java.io.File f)
          Applies the attributes provided as argument
 boolean canRead(java.io.File file)
           
 boolean canWrite(java.io.File file)
           
 boolean createNewFile(java.io.File file)
           
 boolean createSymbolicLink(java.io.File symlink, java.lang.String realPath)
          Create a Symbolic link
 boolean delete(java.io.File file)
           
 void deleteOnExit(java.io.File f)
           
 boolean exists(java.io.File file)
           
 void flush()
           
 java.io.File getAbsoluteFile(java.io.File file)
           
 java.lang.String getAbsolutePath(java.io.File file)
           
 short getAccessEfficiency()
          Tells whether accesses are fast or not
 java.io.InputStream getCachedFileInputStream(java.io.File file)
          Ensures that a local copy of the file exists and return an InputStream on this file
 java.io.OutputStream getCachedFileOutputStream(java.io.File file)
          Returns an OutputStream for the given File
This outputStream will be cached, and written only during call to "flush"
 java.io.File getCanonicalFile(java.io.File file)
           
 java.lang.String getCanonicalPath(java.io.File file)
           
 java.io.InputStream getFileInputStream(java.io.File file)
           
 java.io.OutputStream getFileOutputStream(java.io.File file)
           
 java.io.OutputStream getFileOutputStream(java.io.File file, boolean append)
           
 java.io.OutputStream getFileOutputStream(java.io.File file, boolean append, OutputStreamListener listener)
           
 FileCacheableInformations getInformations(java.io.File file)
          Returns a global set of file informations (length, lastmodified, ...)
 FileMetaData getMetaData(java.io.File f, boolean onlyBasicAttributes)
          Returns the file's attributes
 java.lang.String getName(java.io.File file)
           
 java.lang.String getParent(java.io.File file)
           
 java.io.File getParentFile(java.io.File file)
           
 java.lang.String getPath(java.io.File file)
           
 boolean isAbsolute(java.io.File file)
           
 boolean isContentSensitive()
          Returns true if the driver is sensitive to the content.
 boolean isDirectory(java.io.File file)
           
 boolean isFile(java.io.File file)
           
 boolean isHidden(java.io.File file)
           
 long lastModified(java.io.File file)
           
 long length(java.io.File file)
           
 java.lang.String[] list(java.io.File file)
           
 java.lang.String[] list(java.io.File file, java.io.FilenameFilter filter)
           
 java.io.File[] listFiles(java.io.File file)
           
 java.io.File[] listFiles(java.io.File file, java.io.FileFilter filter)
           
 java.io.File[] listFiles(java.io.File file, java.io.FilenameFilter filter)
           
 boolean mkdir(java.io.File file)
           
 boolean mkdirs(java.io.File file)
           
 void mount()
           
 boolean renameTo(java.io.File source, java.io.File dest)
           
 boolean setLastModified(java.io.File file, long time)
           
 boolean setReadOnly(java.io.File file)
           
 boolean supportsLongFileNames()
           
 void unmount()
           
 

Field Detail

ACCESS_EFFICIENCY_GOOD

static final short ACCESS_EFFICIENCY_GOOD
See Also:
Constant Field Values

ACCESS_EFFICIENCY_AVERAGE

static final short ACCESS_EFFICIENCY_AVERAGE
See Also:
Constant Field Values

ACCESS_EFFICIENCY_POOR

static final short ACCESS_EFFICIENCY_POOR
See Also:
Constant Field Values
Method Detail

canRead

boolean canRead(java.io.File file)

canWrite

boolean canWrite(java.io.File file)

createNewFile

boolean createNewFile(java.io.File file)
                      throws java.io.IOException
Throws:
java.io.IOException

delete

boolean delete(java.io.File file)

exists

boolean exists(java.io.File file)

getAbsoluteFile

java.io.File getAbsoluteFile(java.io.File file)

getAbsolutePath

java.lang.String getAbsolutePath(java.io.File file)

getCanonicalFile

java.io.File getCanonicalFile(java.io.File file)
                              throws java.io.IOException
Throws:
java.io.IOException

getCanonicalPath

java.lang.String getCanonicalPath(java.io.File file)
                                  throws java.io.IOException
Throws:
java.io.IOException

getName

java.lang.String getName(java.io.File file)

getParent

java.lang.String getParent(java.io.File file)

getParentFile

java.io.File getParentFile(java.io.File file)

getPath

java.lang.String getPath(java.io.File file)

isAbsolute

boolean isAbsolute(java.io.File file)

isDirectory

boolean isDirectory(java.io.File file)

isFile

boolean isFile(java.io.File file)

isHidden

boolean isHidden(java.io.File file)

lastModified

long lastModified(java.io.File file)

length

long length(java.io.File file)

list

java.lang.String[] list(java.io.File file)

list

java.lang.String[] list(java.io.File file,
                        java.io.FilenameFilter filter)

listFiles

java.io.File[] listFiles(java.io.File file)

listFiles

java.io.File[] listFiles(java.io.File file,
                         java.io.FileFilter filter)

listFiles

java.io.File[] listFiles(java.io.File file,
                         java.io.FilenameFilter filter)

mkdir

boolean mkdir(java.io.File file)

mkdirs

boolean mkdirs(java.io.File file)

renameTo

boolean renameTo(java.io.File source,
                 java.io.File dest)

setLastModified

boolean setLastModified(java.io.File file,
                        long time)

setReadOnly

boolean setReadOnly(java.io.File file)

deleteOnExit

void deleteOnExit(java.io.File f)

getFileInputStream

java.io.InputStream getFileInputStream(java.io.File file)
                                       throws java.io.IOException
Throws:
java.io.IOException

getFileOutputStream

java.io.OutputStream getFileOutputStream(java.io.File file)
                                         throws java.io.IOException
Throws:
java.io.IOException

getFileOutputStream

java.io.OutputStream getFileOutputStream(java.io.File file,
                                         boolean append,
                                         OutputStreamListener listener)
                                         throws java.io.IOException
Throws:
java.io.IOException

getFileOutputStream

java.io.OutputStream getFileOutputStream(java.io.File file,
                                         boolean append)
                                         throws java.io.IOException
Throws:
java.io.IOException

getCachedFileOutputStream

java.io.OutputStream getCachedFileOutputStream(java.io.File file)
                                               throws java.io.IOException
Returns an OutputStream for the given File
This outputStream will be cached, and written only during call to "flush"

Throws:
java.io.IOException

getCachedFileInputStream

java.io.InputStream getCachedFileInputStream(java.io.File file)
                                             throws java.io.IOException
Ensures that a local copy of the file exists and return an InputStream on this file

Throws:
java.io.IOException

getMetaData

FileMetaData getMetaData(java.io.File f,
                         boolean onlyBasicAttributes)
                         throws java.io.IOException
Returns the file's attributes

Throws:
java.io.IOException

createSymbolicLink

boolean createSymbolicLink(java.io.File symlink,
                           java.lang.String realPath)
                           throws java.io.IOException
Create a Symbolic link

Throws:
java.io.IOException

applyMetaData

void applyMetaData(FileMetaData p,
                   java.io.File f)
                   throws java.io.IOException
Applies the attributes provided as argument

Throws:
java.io.IOException

supportsLongFileNames

boolean supportsLongFileNames()

flush

void flush()
           throws java.io.IOException
Throws:
java.io.IOException

mount

void mount()
           throws java.io.IOException
Throws:
java.io.IOException

unmount

void unmount()
             throws java.io.IOException
Throws:
java.io.IOException

getAccessEfficiency

short getAccessEfficiency()
Tells whether accesses are fast or not


isContentSensitive

boolean isContentSensitive()
Returns true if the driver is sensitive to the content.
In other words, if the driver has a chance to fail during initialization if files pre-exist on its storage location


getInformations

FileCacheableInformations getInformations(java.io.File file)
Returns a global set of file informations (length, lastmodified, ...)