com.mizar.trinidad.components.faces
Class DownloadRequestFactory

java.lang.Object
  extended by com.mizar.trinidad.components.faces.DownloadRequestFactory

public class DownloadRequestFactory
extends java.lang.Object


Constructor Summary
DownloadRequestFactory()
           
 
Method Summary
 void download(javax.faces.context.FacesContext context, java.io.OutputStream out, java.io.File file)
           
 boolean exists(java.lang.String absolutePath)
           
 boolean exists(java.lang.String description, java.lang.String extension)
           
 java.lang.String getAbsoluteFilePath()
           
 java.lang.String getAbsoluteFilePathSansExt()
           
 java.lang.String getCardDirBranch()
           
 java.lang.String getCartDir()
           
 java.lang.String getDefaultTitle()
           
 oracle.lbs.util.JSONObject getDefinition()
           
 java.lang.String getDeployedMediaRoot()
          This is coded into weblogic.xml and we've yet to find a way to read it.
 java.lang.String getDevMediaRoot()
           
 byte[] getFileContent(java.io.File file)
           
 java.lang.String getGeneratedDir()
           
 java.lang.String getGeneratedDirBranch()
           
 java.lang.String getImageUrl()
           
 java.lang.String getImageUrl(java.lang.String absoluteFilePath)
           
 java.lang.String getMediaRoot()
           
 java.lang.String getOutputFile(java.lang.String description)
           
 java.lang.String getOutputFile(java.lang.String description, java.lang.String extension)
           
 java.lang.String getOutputFile(java.lang.String description, java.lang.String extension, boolean appendExtension)
           
 java.lang.String getOutputFile(java.lang.String description, java.lang.String extension, boolean appendExtension, boolean makeUnique)
           
 java.lang.String getOutputFolder()
           
 java.lang.Long getRequestType()
           
 java.lang.String getTitle()
           
 void registerDownloadRequest(java.lang.String absoluteFilePath)
           
 void removeFile(java.io.File file)
           
 void removeFile(java.lang.String absoluteFilename)
           
 void setAbsoluteFilePath(java.lang.String absoluteFilePath)
           
 void setCardDirBranch(java.lang.String cardDirBranch)
           
 void setDefinition(oracle.lbs.util.JSONObject definition)
           
 void setDeployedMediaRoot(java.lang.String deployedMediaRoot)
           
 void setDevMediaRoot(java.lang.String devMediaRoot)
           
 void setGeneratedDirBranch(java.lang.String generatedDirBranch)
           
 void setRequestType(java.lang.Long requestType)
           
 void setTitle(java.lang.String description)
           
 void windowOpen()
           
 void windowOpen(java.lang.String imageUrl)
           
 void writeResponse()
           
 void writeResponse(java.lang.String absoluteFilePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadRequestFactory

public DownloadRequestFactory()
Method Detail

registerDownloadRequest

public void registerDownloadRequest(java.lang.String absoluteFilePath)

getImageUrl

public java.lang.String getImageUrl(java.lang.String absoluteFilePath)
Parameters:
absoluteFilePath -
Returns:

getImageUrl

public java.lang.String getImageUrl()

setAbsoluteFilePath

public void setAbsoluteFilePath(java.lang.String absoluteFilePath)

getAbsoluteFilePath

public java.lang.String getAbsoluteFilePath()

getAbsoluteFilePathSansExt

public java.lang.String getAbsoluteFilePathSansExt()

getMediaRoot

public java.lang.String getMediaRoot()

getGeneratedDir

public java.lang.String getGeneratedDir()

getCartDir

public java.lang.String getCartDir()

getOutputFolder

public java.lang.String getOutputFolder()
                                 throws java.io.IOException
Throws:
java.io.IOException

exists

public boolean exists(java.lang.String description,
                      java.lang.String extension)
               throws java.io.IOException
Parameters:
description - a candidate file name
extension - a file type extension (without the .) to be appended to FileUtils.simpleFileNmae(title)
Returns:
true if the file exists
Throws:
java.io.IOException
See Also:
exists(String), FileUtils.simpleFileName(String)

exists

public boolean exists(java.lang.String absolutePath)
Parameters:
absolutePath -
Returns:
See Also:
exists(String description, String extension), FileUtils.simpleFileName(String)

getOutputFile

public java.lang.String getOutputFile(java.lang.String description)
                               throws java.io.IOException
Parameters:
description - a candidate file name
Returns:
the absolute file name -- guarranteed to be unique
Throws:
java.io.IOException
See Also:
FileUtils.simpleFileName(String)

getOutputFile

public java.lang.String getOutputFile(java.lang.String description,
                                      java.lang.String extension)
                               throws java.io.IOException
Parameters:
description - a candidate file name
extension - a file type extension (without the .) to be appended to FileUtils.simpleFileNmae(title)
Returns:
the absolute file name -- guarranteed to be unique
Throws:
java.io.IOException

getOutputFile

public java.lang.String getOutputFile(java.lang.String description,
                                      java.lang.String extension,
                                      boolean appendExtension)
                               throws java.io.IOException
Parameters:
description - a candidate file name
extension - a file type extension (without the .) to be appended to FileUtils.simpleFileNmae(title)
appendExtension - if false then do not append the extension but use it to test for existing files.
Returns:
the absolute file name -- guarranteed to be unique
Throws:
java.io.IOException

getOutputFile

public java.lang.String getOutputFile(java.lang.String description,
                                      java.lang.String extension,
                                      boolean appendExtension,
                                      boolean makeUnique)
                               throws java.io.IOException
Parameters:
description - a candidate file name
extension - a file type extension (without the .) to be appended to FileUtils.simpleFileNmae(title)
appendExtension - if false then do not append the extension but use it to test for existing files.
makeUnique - if false then allow for existing files which would then overwirte any existing file.
Returns:
the absolute file name
Throws:
java.io.IOException

setDeployedMediaRoot

public void setDeployedMediaRoot(java.lang.String deployedMediaRoot)

getDeployedMediaRoot

public java.lang.String getDeployedMediaRoot()
This is coded into weblogic.xml and we've yet to find a way to read it. BUT ... that must be doable and we'll keep looking.

Returns:

setDevMediaRoot

public void setDevMediaRoot(java.lang.String devMediaRoot)

getDevMediaRoot

public java.lang.String getDevMediaRoot()

setGeneratedDirBranch

public void setGeneratedDirBranch(java.lang.String generatedDirBranch)

getGeneratedDirBranch

public java.lang.String getGeneratedDirBranch()

setCardDirBranch

public void setCardDirBranch(java.lang.String cardDirBranch)

getCardDirBranch

public java.lang.String getCardDirBranch()

setTitle

public void setTitle(java.lang.String description)

getTitle

public java.lang.String getTitle()

getFileContent

public byte[] getFileContent(java.io.File file)

windowOpen

public void windowOpen(java.lang.String imageUrl)

windowOpen

public void windowOpen()

writeResponse

public void writeResponse(java.lang.String absoluteFilePath)

writeResponse

public void writeResponse()

setDefinition

public void setDefinition(oracle.lbs.util.JSONObject definition)

getDefinition

public oracle.lbs.util.JSONObject getDefinition()

setRequestType

public void setRequestType(java.lang.Long requestType)

getRequestType

public java.lang.Long getRequestType()

getDefaultTitle

public java.lang.String getDefaultTitle()

removeFile

public void removeFile(java.lang.String absoluteFilename)

removeFile

public void removeFile(java.io.File file)

download

public void download(javax.faces.context.FacesContext context,
                     java.io.OutputStream out,
                     java.io.File file)
              throws java.lang.Exception
Throws:
java.lang.Exception