lumis.portal.filesystem
Interface IFileSystemManager

Package class diagram package IFileSystemManager
All Known Implementing Classes:
FileSystemManager

@StableMinor(version="6.2",
             sinceVersion="4.1")
public interface IFileSystemManager

Provides operations for manipulating the file system.

Since:
4.1.0

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

lockFileForRead

void lockFileForRead(File file)
Locks a file for reading operations. This lock is obeyed only by threads in the same JVM that also use a lock method available in this manager.

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.

Parameters:
file - the file to be locked.
Since:
4.1.0
See Also:
unlockFileForRead(File), lockFileForWrite(File)

unlockFileForRead

void unlockFileForRead(File file)
Unlocks a file locked by lockFileForRead(File).

Parameters:
file - the file to be unlocked.
Since:
4.1.0
See Also:
lockFileForRead(File)

lockFileForWrite

void lockFileForWrite(File file)
Locks a file for writing operations. This lock is obeyed only by threads in the same JVM that also use a lock method available in this manager.

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.

Parameters:
file - the file to be locked.
Since:
4.1.0
See Also:
unlockFileForWrite(File), lockFileForRead(File)

unlockFileForWrite

void unlockFileForWrite(File file)
Unlocks a file locked by lockFileForWrite(File).

Parameters:
file - the file to be unlocked.
Since:
4.1.0
See Also:
lockFileForWrite(File)

writeFile

void writeFile(PortalFile file,
               byte[] content)
               throws IOException
Writes content in the specified file. The change is replicated across the cluster.

Parameters:
file - the file to write. If it already exists it is overwritten.
content - the content.
Throws:
IOException
Since:
4.1.0

writeFile

void writeFile(PortalFile file,
               InputStream content)
               throws IOException
Writes content in the specified file. The change is replicated across the cluster.

Parameters:
file - the file to write. If it already exists it is overwritten.
content - the content.
Throws:
IOException
Since:
4.1.0

copyFile

void copyFile(PortalFile source,
              PortalFile destination)
              throws IOException
Performs a file copy. The copy operation is repeated across the cluster.

Parameters:
source - the source file.
destination - the destination file. If it already exists it is overwritten.
Throws:
IOException
Since:
4.1.0


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.