Interface IDirectory
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Subinterfaces:
IFSDirectory
- All Known Implementing Classes:
FSDirectory
,FSShallowDirectory
,SubDirectory
,ZipDirectory
public interface IDirectory extends java.io.Closeable
Abstraction of a file repository.- Since:
- 4.0.10
- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
getInputStream
java.io.InputStream getInputStream(java.lang.String filePath) throws java.io.FileNotFoundException, java.io.IOException
Get anInputStream
to a repository file.- 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
java.io.OutputStream getOutputStream(java.lang.String filePath) throws java.io.IOException
Get anOutputStream
to a repository file.- Parameters:
filePath
- path to the file.- Returns:
OutputStream
to the new file- Throws:
java.io.IOException
- if an I/O error occurs.
-
exists
boolean exists(java.lang.String filePath) throws java.io.IOException
Check the existence of a file.- 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
java.lang.String getDescription()
Generate a general description of the directory, used mainly to compose exception messages.- Returns:
- directory description.
-
delete
void delete() throws java.io.IOException
Delete the repository.- Throws:
java.io.IOException
- if an I/O error occurs.
-
-