lumis.portal.file
Class FileManager

Package class diagram package FileManager
java.lang.Object
  extended by lumis.portal.file.FileManager
All Implemented Interfaces:
IFileManager

public class FileManager
extends Object
implements IFileManager

Manager for file and files

Since:
4.0.0

Constructor Summary
FileManager()
           
 
Method Summary
 FileConfig add(SessionConfig sessionConfig, FileConfig fileConfig, ITransaction transaction)
          Adds a file.
 void changeFilename(SessionConfig sessionConfig, String fileId, String newFilename, ITransaction transaction)
          Changes the filename of a file.
 FileConfig get(SessionConfig sessionConfig, String fileId, ITransaction transaction)
          Returns the FileConfig for a file with the given fileId.
 File getFile(SessionConfig sessionConfig, FileConfig fileConfig, ITransaction transaction)
          Returns the File object for accessing the corresponding file in the filesystem.
 Collection<FileConfig> getFileConfigsByFilesId(SessionConfig sessionConfig, String filesId, ITransaction transaction)
          Returns a collection of FileConfig of file entries belonging to the files with the given id.
 IServiceInterfaceUrl getFileHref(SessionConfig sessionConfig, String fileId, ITransaction transaction)
          Returns the href that is used to access the specified file.
 FilesConfig getFilesConfig(SessionConfig sessionConfig, String filesId, ITransaction transaction)
          Returns the FilesConfig for a files with the given filesId.
 FileMimeTypeConfig getMimeType(SessionConfig sessionConfig, String fileMimeType, ITransaction transaction)
          Returns a mime type information.
 int getNumberOfServiceInstanceFiles(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
          Returns the number of files for a service instance.
 void publicServiceInstanceFiles(SessionConfig sessionConfig, String serviceInstanceId, boolean filesArePublic, ITransaction transaction)
          Creates or deletes the public copy of the files of a service instance.
 void removeStoredFile(SessionConfig sessionConfig, String fileId, ITransaction transaction)
          Removes the specified file.
 void removeStoredFiles(SessionConfig sessionConfig, String filesId, ITransaction transaction)
          Removes the files associated with the filesId given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManager

public FileManager()
Method Detail

get

public FileConfig get(SessionConfig sessionConfig,
                      String fileId,
                      ITransaction transaction)
               throws PortalException
Description copied from interface: IFileManager
Returns the FileConfig for a file with the given fileId.

Specified by:
get in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
fileId - the id of the file.
transaction - the transaction for persistence access.
Returns:
the FileConfig for the file, or null if it is not found.
Throws:
PortalException

getFilesConfig

public FilesConfig getFilesConfig(SessionConfig sessionConfig,
                                  String filesId,
                                  ITransaction transaction)
                           throws PortalException
Description copied from interface: IFileManager
Returns the FilesConfig for a files with the given filesId.

Specified by:
getFilesConfig in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
filesId - the id of the files.
transaction - the transaction for persistence access.
Returns:
the FilesConfig for the files, or null if it is not found.
Throws:
PortalException

getFileConfigsByFilesId

public Collection<FileConfig> getFileConfigsByFilesId(SessionConfig sessionConfig,
                                                      String filesId,
                                                      ITransaction transaction)
                                               throws PortalException
Description copied from interface: IFileManager
Returns a collection of FileConfig of file entries belonging to the files with the given id.

Specified by:
getFileConfigsByFilesId in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
filesId - id of the files entry.
transaction - the transaction for persistence access.
Returns:
the collection contaning the FileConfig instances, or an empty collection if none is found.
Throws:
PortalException

removeStoredFile

public void removeStoredFile(SessionConfig sessionConfig,
                             String fileId,
                             ITransaction transaction)
                      throws PortalException
Description copied from interface: IFileManager
Removes the specified file. The file entry from database is removed and the corresponding file in the filesystem is deleted.

Specified by:
removeStoredFile in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
fileId - the file id.
transaction - the transaction for persistence access.
Throws:
PortalException

removeStoredFiles

public void removeStoredFiles(SessionConfig sessionConfig,
                              String filesId,
                              ITransaction transaction)
                       throws PortalException
Description copied from interface: IFileManager
Removes the files associated with the filesId given.

Specified by:
removeStoredFiles in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
filesId - the filesId.
transaction - the transaction for persistence access.
Throws:
PortalException

add

public FileConfig add(SessionConfig sessionConfig,
                      FileConfig fileConfig,
                      ITransaction transaction)
               throws PortalException
Description copied from interface: IFileManager
Adds a file. The file must be available until the transaction is committed.

Specified by:
add in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
fileConfig - file config of the file to be added.
transaction - the transaction for persistence access.
Returns:
the FileConfig for the file added.
Throws:
FileUploadDeniedException - if the file was not added because it did not comply with portal file upload restrictions configuration.
PortalException

getFile

public File getFile(SessionConfig sessionConfig,
                    FileConfig fileConfig,
                    ITransaction transaction)
             throws PortalException
Description copied from interface: IFileManager
Returns the File object for accessing the corresponding file in the filesystem.

Specified by:
getFile in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
fileConfig - the fileConfig of the asked file.
transaction - the transaction for persistence access.
Returns:
the File object for accessing the corresponding file in the filesystem.
Throws:
PortalException

changeFilename

public void changeFilename(SessionConfig sessionConfig,
                           String fileId,
                           String newFilename,
                           ITransaction transaction)
                    throws PortalException
Description copied from interface: IFileManager
Changes the filename of a file.

Specified by:
changeFilename in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
fileId - the file id.
newFilename - the new filename for the file.
transaction - the transaction for persistence access.
Throws:
PortalException

getFileHref

public IServiceInterfaceUrl getFileHref(SessionConfig sessionConfig,
                                        String fileId,
                                        ITransaction transaction)
                                 throws PortalException
Description copied from interface: IFileManager
Returns the href that is used to access the specified file.

Specified by:
getFileHref in interface IFileManager
Parameters:
sessionConfig - identifier for the session.
fileId - the file id.
transaction - the transaction for persistence access.
Throws:
PortalException

publicServiceInstanceFiles

public void publicServiceInstanceFiles(SessionConfig sessionConfig,
                                       String serviceInstanceId,
                                       boolean filesArePublic,
                                       ITransaction transaction)
                                throws PortalException
Description copied from interface: IFileManager
Creates or deletes the public copy of the files of a service instance.

Specified by:
publicServiceInstanceFiles in interface IFileManager
Parameters:
sessionConfig - the user session information.
serviceInstanceId - the service instance id.
filesArePublic - if true the files are copied to the public area, if false the files are deleted from the public area.
transaction - the transaction for persistence access.
Throws:
PortalException

getMimeType

public FileMimeTypeConfig getMimeType(SessionConfig sessionConfig,
                                      String fileMimeType,
                                      ITransaction transaction)
                               throws PortalException
Description copied from interface: IFileManager
Returns a mime type information.

Specified by:
getMimeType in interface IFileManager
Parameters:
sessionConfig - the user session information.
fileMimeType - the mime type.
transaction - the transaction for persistence access.
Returns:
the mime type information.
Throws:
PortalException

getNumberOfServiceInstanceFiles

public int getNumberOfServiceInstanceFiles(SessionConfig sessionConfig,
                                           String serviceInstanceId,
                                           ITransaction transaction)
                                    throws PortalException
Description copied from interface: IFileManager
Returns the number of files for a service instance.

Specified by:
getNumberOfServiceInstanceFiles in interface IFileManager
Parameters:
sessionConfig - the user session information.
serviceInstanceId - the service instance identifier.
transaction - the transaction for persistence access.
Returns:
the number of files for the specified service instance.
Throws:
PortalException


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.