public interface FileSupport
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getReceivedFileName(Message msg)
Retrieves the filename from which this message has been constructed provided that this message is received via
the file transport or as an AS2 message
|
java.lang.String |
getReceivedFilePath(Message msg)
Retrieves the file path from which this message has been constructed provided that this message is received via
the file transport
|
java.util.Collection |
listFiles(java.lang.String fileURL)
Lists the files in the directory described by the given file path
|
java.io.InputStream |
readFile(java.lang.String fileURL)
Reads a file given by the file URL (including a SFTP, FTP or FTPS) into a stream
|
java.lang.String |
readTextFile(java.lang.String fileURL)
Reads a file in the given file URL as a text file into a String, using the platform encoding
|
void |
setFileName(Message msg,
java.lang.String fileName)
Sets the name of the file to be used to send the message out via the file transport
|
void |
storeMessage(Message msg,
java.lang.String filePath)
Stores the given message payload into a file described by the given file URL
|
void |
writeTextFile(java.lang.String fileURL,
java.lang.String content)
A convenience mechanism to write a String to a file
|
java.lang.String getReceivedFileName(Message msg)
msg
- the message of which the received file name to be fetchedjava.lang.String getReceivedFilePath(Message msg)
msg
- the message of which the received file path to be fetchedvoid setFileName(Message msg, java.lang.String fileName)
msg
- the message to which the file name will be setfileName
- the file name to be setjava.io.InputStream readFile(java.lang.String fileURL) throws java.io.FileNotFoundException
fileURL
- the file URL to be readjava.io.FileNotFoundException
- if the file cannot be locatedjava.lang.String readTextFile(java.lang.String fileURL) throws java.io.IOException
fileURL
- the file URL from which the file to be readjava.io.IOException
- if the file cannot be located or readvoid writeTextFile(java.lang.String fileURL, java.lang.String content) throws java.io.IOException
fileURL
- the file URL to which the payload should be writtencontent
- the String content to be written to the filejava.io.IOException
- if the file cannot be located or writtenvoid storeMessage(Message msg, java.lang.String filePath) throws java.io.IOException
msg
- the message to be stored into a filefilePath
- the path of the file to be used in storing the given messagejava.io.IOException
- if the file to be written cannot be located nor has permission issuesjava.util.Collection listFiles(java.lang.String fileURL)
fileURL
- the file path of which the children files to be listed