Class SubDirectory
- java.lang.Object
-
- lumis.portal.serialization.persistency.sub.SubDirectory
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,IDirectory
public class SubDirectory extends java.lang.Object implements IDirectory
IDirectory
implementation that represents a subdirectory of anotherIDirectory
.- Since:
- 4.0.10
- Version:
- $Revision: 6376 $ $Date: 2007-04-10 17:55:53 -0300 (Tue, 10 Apr 2007) $
-
-
Constructor Summary
Constructors Constructor Description SubDirectory(IDirectory directory, java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
delete()
Delete the repository.boolean
exists(java.lang.String filePath)
Check the existence of a file.java.lang.String
getDescription()
Generate a general description of the directory, used mainly to compose exception messages.java.io.InputStream
getInputStream(java.lang.String filePath)
Get anInputStream
to a repository file.java.io.OutputStream
getOutputStream(java.lang.String filePath)
Get anOutputStream
to a repository file.
-
-
-
Constructor Detail
-
SubDirectory
public SubDirectory(IDirectory directory, java.lang.String path)
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream(java.lang.String filePath) throws java.io.FileNotFoundException, java.io.IOException
Description copied from interface:IDirectory
Get anInputStream
to a repository file.- Specified by:
getInputStream
in interfaceIDirectory
- Parameters:
filePath
- path to the file.- Returns:
InputStream
to file found in specified filePath.- Throws:
java.io.FileNotFoundException
- if no file was found in specified filePath.java.io.IOException
- if an I/O error occurs.
-
getOutputStream
public java.io.OutputStream getOutputStream(java.lang.String filePath) throws java.io.IOException
Description copied from interface:IDirectory
Get anOutputStream
to a repository file.- Specified by:
getOutputStream
in interfaceIDirectory
- Parameters:
filePath
- path to the file.- Returns:
OutputStream
to the new file- Throws:
java.io.IOException
- if an I/O error occurs.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
exists
public boolean exists(java.lang.String filePath) throws java.io.IOException
Description copied from interface:IDirectory
Check the existence of a file.- Specified by:
exists
in interfaceIDirectory
- Parameters:
filePath
- path to the file to be checked.- Returns:
- true, if the specified file exists.
- Throws:
java.io.IOException
- if an I/O error occurs.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IDirectory
Generate a general description of the directory, used mainly to compose exception messages.- Specified by:
getDescription
in interfaceIDirectory
- Returns:
- directory description.
-
delete
public void delete() throws java.io.IOException
Description copied from interface:IDirectory
Delete the repository.- Specified by:
delete
in interfaceIDirectory
- Throws:
java.io.IOException
- if an I/O error occurs.
-
-