org.objectweb.telosys.upload
Class FileManager

java.lang.Object
  extended byorg.objectweb.telosys.upload.FileManager

public class FileManager
extends java.lang.Object

File management methods


Constructor Summary
FileManager()
           
 
Method Summary
static java.lang.String buildFilePath(java.lang.String psUploadDirectory, java.lang.String psDir, java.lang.String psFileName)
          Builds a file path using the given parameters
static java.io.File getFileFromFilesystem(java.lang.String psUploadDirectory, java.lang.String psDir, java.lang.String psFileName)
          Returns a File object for the given parameters
static FileUploaded getFileFromHttpSession(javax.servlet.http.HttpServletRequest req, java.lang.String sSessionKey)
          Retuns the FileUploaded object stored in the Http Session
static FileUploaded getFileFromScreenContext(javax.servlet.http.HttpServletRequest request, int iContextId, java.lang.String sContextAttribute)
          Retuns the FileUploaded object stored as a Screen Context attribute
static boolean removeFileFromHttpSession(javax.servlet.http.HttpServletRequest req, java.lang.String sSessionKey)
          Removes the FileUploaded object from the Http Session if any
 
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

getFileFromHttpSession

public static final FileUploaded getFileFromHttpSession(javax.servlet.http.HttpServletRequest req,
                                                        java.lang.String sSessionKey)
Retuns the FileUploaded object stored in the Http Session

Parameters:
req -
sSessionKey - the session attribute key
Returns:

getFileFromScreenContext

public static final FileUploaded getFileFromScreenContext(javax.servlet.http.HttpServletRequest request,
                                                          int iContextId,
                                                          java.lang.String sContextAttribute)
Retuns the FileUploaded object stored as a Screen Context attribute

Parameters:
request -
iContextId -
sContextAttribute -
Returns:

getFileFromFilesystem

public static final java.io.File getFileFromFilesystem(java.lang.String psUploadDirectory,
                                                       java.lang.String psDir,
                                                       java.lang.String psFileName)
                                                throws TelosysException
Returns a File object for the given parameters

Parameters:
psUploadDirectory -
psDir -
psFileName -
Returns:
Throws:
TelosysException

buildFilePath

public static final java.lang.String buildFilePath(java.lang.String psUploadDirectory,
                                                   java.lang.String psDir,
                                                   java.lang.String psFileName)
                                            throws TelosysException
Builds a file path using the given parameters

Parameters:
psUploadDirectory - the "upload directory" (cannot be null)
psDir - the subdirectory in the "upload directory" ( if null : none )
psFileName - the file name
Returns:
Throws:
TelosysException

removeFileFromHttpSession

public static final boolean removeFileFromHttpSession(javax.servlet.http.HttpServletRequest req,
                                                      java.lang.String sSessionKey)
Removes the FileUploaded object from the Http Session if any

Parameters:
req -
sSessionKey - the session attribute key
Returns: