|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.portal.filesystem.FileSystemManager
public class FileSystemManager
Implementation of the file system manager.
Nested Class Summary | |
---|---|
static class |
FileSystemManager.WriteFileCommand
Command used to perform the write operation of a file. |
Constructor Summary | |
---|---|
FileSystemManager()
|
Method Summary | |
---|---|
void |
copyFile(PortalFile source,
PortalFile destination)
Performs a file copy. |
void |
lockFileForRead(File file)
Locks a file for reading operations. |
void |
lockFileForWrite(File file)
Locks a file for writing operations. |
void |
unlockFileForRead(File file)
Unlocks a file locked by IFileSystemManager.lockFileForRead(File) . |
void |
unlockFileForWrite(File file)
Unlocks a file locked by IFileSystemManager.lockFileForWrite(File) . |
void |
writeFile(PortalFile file,
byte[] content)
Writes content in the specified file. |
void |
writeFile(PortalFile file,
InputStream content)
Writes content in the specified file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileSystemManager()
Method Detail |
---|
public void lockFileForRead(File file)
IFileSystemManager
Many threads may acquire read locks simultaneously, but if a thread acquire a write lock for a file, no other thread can acquire any lock. If the file is already locked anyway that this thread cannot acquire the lock, it is blocked until the lock can be acquired.
IFileSystemManager.unlockFileForRead(File)
must be executed after this method. A
try/finally block should be used in order to guarantee this.
lockFileForRead
in interface IFileSystemManager
file
- the file to be locked.IFileSystemManager.unlockFileForRead(File)
,
IFileSystemManager.lockFileForWrite(File)
public void unlockFileForRead(File file)
IFileSystemManager
IFileSystemManager.lockFileForRead(File)
.
unlockFileForRead
in interface IFileSystemManager
file
- the file to be unlocked.IFileSystemManager.lockFileForRead(File)
public void lockFileForWrite(File file)
IFileSystemManager
Many threads may acquire read locks simultaneously, but if a thread acquire a write lock for a file, no other thread can acquire any lock. If the file is already locked anyway that this thread cannot acquire the lock, it is blocked until the lock can be acquired.
IFileSystemManager.unlockFileForWrite(File)
must be executed after this method. A
try/finally block should be used in order to guarantee this.
lockFileForWrite
in interface IFileSystemManager
file
- the file to be locked.IFileSystemManager.unlockFileForWrite(File)
,
IFileSystemManager.lockFileForRead(File)
public void unlockFileForWrite(File file)
IFileSystemManager
IFileSystemManager.lockFileForWrite(File)
.
unlockFileForWrite
in interface IFileSystemManager
file
- the file to be unlocked.IFileSystemManager.lockFileForWrite(File)
public void writeFile(PortalFile file, byte[] content) throws IOException
IFileSystemManager
writeFile
in interface IFileSystemManager
file
- the file to write. If it already exists it is
overwritten.content
- the content.
IOException
public void writeFile(PortalFile file, InputStream content) throws IOException
IFileSystemManager
writeFile
in interface IFileSystemManager
file
- the file to write. If it already exists it is
overwritten.content
- the content.
IOException
public void copyFile(PortalFile source, PortalFile destination) throws IOException
IFileSystemManager
copyFile
in interface IFileSystemManager
source
- the source file.destination
- the destination file. If it already exists it is
overwritten.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |