org.imemex.datasourceplugins.filesystem
Class AbstractFile

java.lang.Object
  extended by org.imemex.datasourceplugins.filesystem.AbstractFile
Direct Known Subclasses:
FSFileAdapter, SMBFileAdapter

public abstract class AbstractFile
extends java.lang.Object

Factory class for different file systems like local file system or SMB file system.

Author:
shk

Method Summary
abstract  boolean canWrite()
           
abstract  boolean exists()
          Common interfaces provided by the file systems.
abstract  java.lang.String getAbsolutePath()
           
 java.lang.String getAbsoluteRelativePath()
          Obtains the relative path of this pathname with respect to the root path of the data source.
abstract  java.lang.String getCanonicalPath()
           
 java.lang.String getCanonicalRelativePath()
          Obtains the relative path of this pathname with respect to the root path of the data source.
abstract  java.io.InputStream getFileInputStream()
           
abstract  java.io.OutputStream getFileOutputStream()
           
abstract  java.lang.String getMimeType()
           
abstract  boolean isDirectory()
           
abstract  boolean isFile()
           
abstract  boolean isHidden()
           
abstract  boolean isLink()
           
abstract  long lastModified()
           
abstract  long length()
           
abstract  AbstractFile[] listFiles()
           
static AbstractFile newAbstractFile(java.net.URI dataSourceUri, java.lang.String pluginAssignedId)
          returns a specific file system object given the data source URI and the plugin assigned Id
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newAbstractFile

public static AbstractFile newAbstractFile(java.net.URI dataSourceUri,
                                           java.lang.String pluginAssignedId)
returns a specific file system object given the data source URI and the plugin assigned Id

Parameters:
dataSourceUri -
pluginAssignedId -
Returns:

getAbsoluteRelativePath

public java.lang.String getAbsoluteRelativePath()
Obtains the relative path of this pathname with respect to the root path of the data source. The relative path is computed based on the absolute path of this pathname. If the path returned is absolute, then it is prefixed by a "!" character.

Returns:
the relative path with respect to the root of the data source.

getCanonicalRelativePath

public java.lang.String getCanonicalRelativePath()
Obtains the relative path of this pathname with respect to the root path of the data source. The relative path is computed based on the canonical path of this pathname. If the path returned is absolute, then it is prefixed by a "!" character.

Returns:
the relative path with respect to the root of the data source.

exists

public abstract boolean exists()
Common interfaces provided by the file systems.

Returns:

length

public abstract long length()

getAbsolutePath

public abstract java.lang.String getAbsolutePath()

getCanonicalPath

public abstract java.lang.String getCanonicalPath()

canWrite

public abstract boolean canWrite()

isHidden

public abstract boolean isHidden()

lastModified

public abstract long lastModified()

isDirectory

public abstract boolean isDirectory()

isFile

public abstract boolean isFile()

isLink

public abstract boolean isLink()

getMimeType

public abstract java.lang.String getMimeType()

getFileInputStream

public abstract java.io.InputStream getFileInputStream()
                                                throws java.io.IOException
Throws:
java.io.IOException

getFileOutputStream

public abstract java.io.OutputStream getFileOutputStream()
                                                  throws java.io.IOException
Throws:
java.io.IOException

listFiles

public abstract AbstractFile[] listFiles()