com.jurismarches.vradi.services
Class FileServiceImpl

java.lang.Object
  extended by com.jurismarches.vradi.services.FileServiceImpl
All Implemented Interfaces:
FileService

public class FileServiceImpl
extends Object
implements FileService

File service impl.

Version:
$Revision: 1817 $ Last update : $Date: 2010-12-01 18:20:15 +0100 (mer., 01 déc. 2010) $ By : $Author: sletellier $
Author:
chatellier

Field Summary
protected  org.nuiton.util.ApplicationConfig config
           
 
Constructor Summary
FileServiceImpl()
           
FileServiceImpl(org.nuiton.util.ApplicationConfig config)
           
 
Method Summary
 File downloadFormAttachment(boolean convertUrl, String fileName, String formId)
          Download file.
 File downloadFormAttachment(String uri)
          Download file.
 File downloadFormAttachment(String fileName, String formId)
          Download file.
 File downloadFormEmbeddedFile(boolean convertUrl, String fileName, String formId)
          Download file.
 File downloadFormEmbeddedFile(String uri)
          Download file.
 File downloadFormEmbeddedFile(String fileName, String formId)
          Download file.
 File downloadPDF(boolean convertUrl, String uri)
          Download pdf file.
 File downloadPDF(String uri)
          Download pdf file.
 File downloadRequestHistory(boolean convertUrl, String uri)
          Download request history file.
 File downloadRequestHistory(String uri)
          Download request histiory file.
 File downloadTemplate(boolean convertUrl, String extensionName, String templateName)
          Download file.
 File downloadTemplate(String extensionName, String templateName)
          Download file.
 File downloadWebHarvestScript(boolean convertUrl, String uri)
          Download file.
 File downloadWebHarvestScript(String uri)
          Download file.
 String getFormEmbeddedUrl(String fileName, String formId)
           
 String getPDFUrl(String uri)
          Download pdf file.
 String getRequestHistoryURL(String uri)
          Get the url of request history.
 String uploadFormAttachment(File file, String formId)
          Upload a form attachment.
 String uploadFormEmbeddedFile(File file, String formId)
          Upload a form attachement.
 String uploadTempFile(File file)
          Upload a temporary file (for example for export).
 String uploadTemplate(File file, String extensionName)
          Upload a template on server.
 String uploadWebHarvestScript(File file)
          Upload a web harvest script on server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected org.nuiton.util.ApplicationConfig config
Constructor Detail

FileServiceImpl

public FileServiceImpl()

FileServiceImpl

public FileServiceImpl(org.nuiton.util.ApplicationConfig config)
Method Detail

uploadTemplate

public String uploadTemplate(File file,
                             String extensionName)
                      throws VradiException
Description copied from interface: FileService
Upload a template on server.

Specified by:
uploadTemplate in interface FileService
Parameters:
file - file to upload
extensionName - extension name to put file into
Returns:
file uri to reference file
Throws:
VradiException - throw VradiException if exception is occured

downloadTemplate

public File downloadTemplate(String extensionName,
                             String templateName)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadTemplate in interface FileService
Parameters:
extensionName - extension name
templateName - template name
Returns:
locally downloaded file

downloadTemplate

public File downloadTemplate(boolean convertUrl,
                             String extensionName,
                             String templateName)
                      throws VradiException
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadTemplate in interface FileService
Parameters:
convertUrl - if convertion url is necessary
extensionName - extension name
templateName - template name
Returns:
locally downloaded file
Throws:
VradiException - throw VradiException if exception is occured

uploadWebHarvestScript

public String uploadWebHarvestScript(File file)
                              throws VradiException
Description copied from interface: FileService
Upload a web harvest script on server.

Specified by:
uploadWebHarvestScript in interface FileService
Parameters:
file - file to upload
Returns:
file uri to reference file
Throws:
VradiException - throw VradiException if exception is occured

downloadWebHarvestScript

public File downloadWebHarvestScript(String uri)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadWebHarvestScript in interface FileService
Parameters:
uri - file uri to download
Returns:
locally downloaded file

downloadWebHarvestScript

public File downloadWebHarvestScript(boolean convertUrl,
                                     String uri)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadWebHarvestScript in interface FileService
Parameters:
convertUrl - if convertion url is necessary
uri - file uri to download
Returns:
locally downloaded file

downloadPDF

public File downloadPDF(String uri)
Description copied from interface: FileService
Download pdf file. File may be temporary.

Specified by:
downloadPDF in interface FileService
Parameters:
uri - file uri to download
Returns:
locally downloaded file

downloadPDF

public File downloadPDF(boolean convertUrl,
                        String uri)
Description copied from interface: FileService
Download pdf file. File may be temporary.

Specified by:
downloadPDF in interface FileService
Parameters:
convertUrl - if convertion url is necessary
uri - file uri to download
Returns:
locally downloaded file

getPDFUrl

public String getPDFUrl(String uri)
                 throws VradiException
Description copied from interface: FileService
Download pdf file.

Specified by:
getPDFUrl in interface FileService
Parameters:
uri - corresponding to history
Returns:
url to go to file
Throws:
VradiException - throw VradiException if exception is occured

uploadFormAttachment

public String uploadFormAttachment(File file,
                                   String formId)
                            throws VradiException
Description copied from interface: FileService
Upload a form attachment.

Specified by:
uploadFormAttachment in interface FileService
Parameters:
file - file to upload
formId - form id
Returns:
file uri to reference file
Throws:
VradiException - if an exception occurred

uploadTempFile

public String uploadTempFile(File file)
                      throws VradiException
Description copied from interface: FileService
Upload a temporary file (for example for export).

Specified by:
uploadTempFile in interface FileService
Parameters:
file - The file to upload
Returns:
an absolute URI on server file system
Throws:
VradiException - if an exception occurred

downloadFormAttachment

public File downloadFormAttachment(String uri)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadFormAttachment in interface FileService
Parameters:
uri - file uri to download
Returns:
locally downloaded file

downloadFormAttachment

public File downloadFormAttachment(String fileName,
                                   String formId)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadFormAttachment in interface FileService
Parameters:
fileName - to download
formId - concerned
Returns:
locally downloaded file

downloadFormAttachment

public File downloadFormAttachment(boolean convertUrl,
                                   String fileName,
                                   String formId)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadFormAttachment in interface FileService
Parameters:
convertUrl - if convertion url is necessary
Returns:
locally downloaded file

uploadFormEmbeddedFile

public String uploadFormEmbeddedFile(File file,
                                     String formId)
                              throws VradiException
Description copied from interface: FileService
Upload a form attachement.

Specified by:
uploadFormEmbeddedFile in interface FileService
Parameters:
file - file to upload
formId - form id
Returns:
file uri to reference file
Throws:
VradiException - throw VradiException if exception is occured

downloadFormEmbeddedFile

public File downloadFormEmbeddedFile(String uri)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadFormEmbeddedFile in interface FileService
Parameters:
uri - file uri to download
Returns:
locally downloaded file

downloadFormEmbeddedFile

public File downloadFormEmbeddedFile(String fileName,
                                     String formId)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadFormEmbeddedFile in interface FileService
Parameters:
fileName - to download
formId - form id
Returns:
locally downloaded file

downloadFormEmbeddedFile

public File downloadFormEmbeddedFile(boolean convertUrl,
                                     String fileName,
                                     String formId)
Description copied from interface: FileService
Download file. File may be temporary.

Specified by:
downloadFormEmbeddedFile in interface FileService
Parameters:
convertUrl - if convertion url is necessary
fileName - to download
formId - form id
Returns:
locally downloaded file

getFormEmbeddedUrl

public String getFormEmbeddedUrl(String fileName,
                                 String formId)
                          throws VradiException
Specified by:
getFormEmbeddedUrl in interface FileService
Throws:
VradiException

downloadRequestHistory

public File downloadRequestHistory(String uri)
                            throws VradiException
Description copied from interface: FileService
Download request histiory file. File may be temporary.

Specified by:
downloadRequestHistory in interface FileService
Parameters:
uri - corresponding to history
Returns:
url to go to file
Throws:
VradiException - throw VradiException if exception is occured

downloadRequestHistory

public File downloadRequestHistory(boolean convertUrl,
                                   String uri)
                            throws VradiException
Description copied from interface: FileService
Download request history file. File may be temporary.

Specified by:
downloadRequestHistory in interface FileService
Parameters:
convertUrl - if convertion url is necessary
uri - corresponding to history
Returns:
url to go to file
Throws:
VradiException - throw VradiException if exception is occured

getRequestHistoryURL

public String getRequestHistoryURL(String uri)
                            throws VradiException
Description copied from interface: FileService
Get the url of request history.

Specified by:
getRequestHistoryURL in interface FileService
Parameters:
uri - corresponding to history
Returns:
url to go to file
Throws:
VradiException - throw VradiException if exception is occured


Copyright © 2009-2010 JurisMarches. All Rights Reserved.