|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@StableMinor(version="6.2", sinceVersion="4.1") public interface IFileSystemManager
Provides operations for manipulating the file system.
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 lockFileForRead(File) . |
void |
unlockFileForWrite(File file)
Unlocks a file locked by 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. |
Method Detail |
---|
void lockFileForRead(File file)
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.
unlockFileForRead(File)
must be executed after this method. A
try/finally block should be used in order to guarantee this.
file
- the file to be locked.unlockFileForRead(File)
,
lockFileForWrite(File)
void unlockFileForRead(File file)
lockFileForRead(File)
.
file
- the file to be unlocked.lockFileForRead(File)
void lockFileForWrite(File file)
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.
unlockFileForWrite(File)
must be executed after this method. A
try/finally block should be used in order to guarantee this.
file
- the file to be locked.unlockFileForWrite(File)
,
lockFileForRead(File)
void unlockFileForWrite(File file)
lockFileForWrite(File)
.
file
- the file to be unlocked.lockFileForWrite(File)
void writeFile(PortalFile file, byte[] content) throws IOException
file
- the file to write. If it already exists it is
overwritten.content
- the content.
IOException
void writeFile(PortalFile file, InputStream content) throws IOException
file
- the file to write. If it already exists it is
overwritten.content
- the content.
IOException
void copyFile(PortalFile source, PortalFile destination) throws IOException
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 |