|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.bc.filetransfer.util.FileTransferUtils
public class FileTransferUtils
| Constructor Summary | |
|---|---|
FileTransferUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
addDateToFileName(java.lang.String filename)
Add the current time as suffix of the filename |
static void |
addFileAsAttachment(java.io.File file,
java.lang.String filename,
javax.jbi.messaging.NormalizedMessage message)
Send the file as an attachment |
static ConsumeConfiguration |
buildConsumeConfiguration(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
Build the configuration for consume service-unit. |
static boolean |
checkAccess(java.io.File file)
check if the file can be read |
static java.lang.String |
checkTransferModeInBaseMsg(java.lang.String baseMsg)
Extract the transfer mode variable in the base message. |
static java.lang.String |
checkTransferModeInSU(java.lang.String suTransferMode)
Extract the transfer mode described in the jbi.xml of the service unit. |
static void |
copyFileToContent(java.io.File file,
javax.jbi.messaging.NormalizedMessage message)
Send the file as a Source |
static org.w3c.dom.Document |
createMessageOnBaseMsg(java.io.File processedFile,
java.lang.String fileName,
java.lang.String baseMsg,
java.lang.String transferMode)
Create message based on the xml structure define by the base-msg parameter |
static org.w3c.dom.Document |
createMessageOnDefaultMsg(java.io.File processedFile,
java.lang.String fileName,
java.lang.String transferMode)
Create message based on default message structure. |
static java.lang.String |
evaluateFilePath(java.lang.String filePath)
Evaluate a file path to resolve environment variables (place holders). |
static java.lang.String |
extractFilePattern(org.ow2.petals.component.framework.api.message.Exchange exchange)
extract in the exchange request the filepattern to use |
static org.w3c.dom.Document |
generateMTOMListResponse(java.util.List<java.lang.String> names,
javax.xml.namespace.QName operation)
Generate a MTOM response structure for a list of files. |
static org.w3c.dom.Document |
generateMTOMResponse(java.lang.String name,
javax.xml.namespace.QName operation)
Generate a MTOM response structure for a single file. |
static java.io.File |
getBackupDirectory(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
Return the backup directory, null if it is not configured. |
static java.io.File |
getFolderPath(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
Return the workspace directory |
static java.lang.String |
getValidMepMessageForOperation(java.lang.String operation,
org.ow2.petals.component.framework.api.Message.MEPConstants... mep)
Build a message to indicate the mep available for this operation. |
static java.io.File[] |
listFiles(java.io.File readDir,
java.lang.String filePattern)
return the files contained in the READ DIRECTORY set in the extensions, using the given filePattern |
static java.io.File |
moveFile(java.io.File file,
org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
move file to the backup directory specified in the SU if no backup directory if set, move to the Temp directory. |
static void |
setIOFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange,
java.lang.String ioMessage)
TODO : create the fault from its WSDL description. |
static void |
setMissingElementFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange,
java.lang.String missingElement)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileTransferUtils()
| Method Detail |
|---|
public static final java.lang.String addDateToFileName(java.lang.String filename)
filename -
public static final void addFileAsAttachment(java.io.File file,
java.lang.String filename,
javax.jbi.messaging.NormalizedMessage message)
throws javax.jbi.messaging.MessagingException,
java.io.IOException
file -
javax.jbi.messaging.MessagingException
java.io.IOException
public static ConsumeConfiguration buildConsumeConfiguration(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
throws javax.jbi.messaging.MessagingException
extensions -
javax.jbi.messaging.MessagingExceptionpublic static final boolean checkAccess(java.io.File file)
file -
public static java.lang.String checkTransferModeInBaseMsg(java.lang.String baseMsg)
throws javax.jbi.messaging.MessagingException
baseMsg -
javax.jbi.messaging.MessagingException
public static java.lang.String checkTransferModeInSU(java.lang.String suTransferMode)
throws javax.jbi.messaging.MessagingException
suTransferMode -
javax.jbi.messaging.MessagingException
public static final void copyFileToContent(java.io.File file,
javax.jbi.messaging.NormalizedMessage message)
throws java.io.IOException,
javax.jbi.messaging.MessagingException
file - message -
java.io.IOException
javax.jbi.messaging.MessagingException
public static org.w3c.dom.Document createMessageOnBaseMsg(java.io.File processedFile,
java.lang.String fileName,
java.lang.String baseMsg,
java.lang.String transferMode)
throws java.io.IOException,
javax.jbi.messaging.MessagingException
processedFile - The processed file.fileName - When processing file as attachment,filename is the content
id(MTOM)baseMsg - The base msg.transferMode - Represent the transfer mode to use.(attachment or content)
java.io.IOException
org.xml.sax.SAXException
javax.jbi.messaging.MessagingException
public static org.w3c.dom.Document createMessageOnDefaultMsg(java.io.File processedFile,
java.lang.String fileName,
java.lang.String transferMode)
throws java.io.IOException,
javax.jbi.messaging.MessagingException
processedFile - The processed file.fileName - When processing file as attachment,filename is the content
id(MTOM)transferMode - Represent the transfer mode to use.(attachment or content)
java.io.IOException
javax.jbi.messaging.MessagingExceptionpublic static final java.lang.String evaluateFilePath(java.lang.String filePath)
public static java.lang.String extractFilePattern(org.ow2.petals.component.framework.api.message.Exchange exchange)
throws javax.jbi.messaging.MessagingException,
java.io.FileNotFoundException
exchange -
javax.jbi.messaging.MessagingException - error while accessing the Exchange
java.io.FileNotFoundException - element not found in the XML request
public static final org.w3c.dom.Document generateMTOMListResponse(java.util.List<java.lang.String> names,
javax.xml.namespace.QName operation)
names - operation -
public static org.w3c.dom.Document generateMTOMResponse(java.lang.String name,
javax.xml.namespace.QName operation)
names - operation -
public static final java.io.File getBackupDirectory(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
throws java.io.IOException
null if it is not configured.
java.io.IOException
public static final java.io.File getFolderPath(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
throws java.io.IOException
PEtALSCFException - no working directory specified in the SU
java.io.IOException
public static final java.lang.String getValidMepMessageForOperation(java.lang.String operation,
org.ow2.petals.component.framework.api.Message.MEPConstants... mep)
operation - mep -
public static final java.io.File[] listFiles(java.io.File readDir,
java.lang.String filePattern)
extensions -
public static final java.io.File moveFile(java.io.File file,
org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
throws java.io.IOException
file -
java.io.IOException
public static final void setIOFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange,
java.lang.String ioMessage)
throws javax.jbi.messaging.MessagingException
exchange - ioMessage -
javax.jbi.JBIException
javax.jbi.messaging.MessagingException
public static final void setMissingElementFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange,
java.lang.String missingElement)
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||