public class FileSystemManager extends Object implements IFileSystemManager
Modifier and Type | Class and Description |
---|---|
static class |
FileSystemManager.WriteFileCommand
Command used to perform the write operation of a file.
|
Constructor and Description |
---|
FileSystemManager() |
Modifier and Type | Method and Description |
---|---|
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.
|
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
Lumisportal 7.1.1.140331 - Copyright © 2006–2014 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.