lumis.portal.serialization.persistency.fs
Class FSDirectory

Package class diagram package FSDirectory
java.lang.Object
  extended by lumis.portal.serialization.persistency.fs.FSDirectory
All Implemented Interfaces:
Closeable, IDirectory, IFSDirectory
Direct Known Subclasses:
FSShallowDirectory

public class FSDirectory
extends Object
implements IFSDirectory

IDirectory implementation that uses a file system's directory as the concrete repository.

Since:
4.0.10

Field Summary
protected  File rootFile
           
 
Constructor Summary
FSDirectory(File root)
           
FSDirectory(String rootPath)
           
 
Method Summary
 void close()
           
 void delete()
          Delete the repository.
 boolean exists(String filePath)
          Check the existence of a file.
 String getDescription()
          Generate a general description of the directory, used mainly to compose exception messages.
 String getDirectoryPath()
           
 InputStream getInputStream(String filePath)
          Get an InputStream to a repository file.
 OutputStream getOutputStream(String filePath)
          Get an OutputStream to a repository file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootFile

protected File rootFile
Constructor Detail

FSDirectory

public FSDirectory(String rootPath)

FSDirectory

public FSDirectory(File root)
Method Detail

getInputStream

public InputStream getInputStream(String filePath)
                           throws FileNotFoundException,
                                  IOException
Description copied from interface: IDirectory
Get an InputStream to a repository file.

Specified by:
getInputStream in interface IDirectory
Parameters:
filePath - path to the file.
Returns:
InputStream to file found in specified filePath.
Throws:
FileNotFoundException - if no file was found in specified filePath.
IOException - if an I/O error occurs.

getOutputStream

public OutputStream getOutputStream(String filePath)
                             throws IOException
Description copied from interface: IDirectory
Get an OutputStream to a repository file.

Specified by:
getOutputStream in interface IDirectory
Parameters:
filePath - path to the file.
Returns:
OutputStream to the new file
Throws:
IOException - if an I/O error occurs.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

exists

public boolean exists(String filePath)
               throws IOException
Description copied from interface: IDirectory
Check the existence of a file.

Specified by:
exists in interface IDirectory
Parameters:
filePath - path to the file to be checked.
Returns:
true, if the specified file exists.
Throws:
IOException - if an I/O error occurs.

getDescription

public String getDescription()
Description copied from interface: IDirectory
Generate a general description of the directory, used mainly to compose exception messages.

Specified by:
getDescription in interface IDirectory
Returns:
directory description.

delete

public void delete()
            throws IOException
Description copied from interface: IDirectory
Delete the repository.

Specified by:
delete in interface IDirectory
Throws:
IOException - if an I/O error occurs.

getDirectoryPath

public String getDirectoryPath()
Specified by:
getDirectoryPath in interface IFSDirectory


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.