public interface FileSupport
Modifier and Type | Method and Description |
---|---|
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
|
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
|
Collection<File> |
listFiles(String fileURL)
Lists the files in the directory described by the given file path
|
InputStream |
readFile(String fileURL)
Reads a file given by the file URL (including a SFTP, FTP or FTPS) into a stream
|
String |
readTextFile(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,
String fileName)
Sets the name of the file to be used to send the message out via the file transport
|
void |
storeMessage(Message msg,
String filePath)
Stores the given message payload into a file described by the given file URL
|
void |
writeTextFile(String fileURL,
String content)
A convenience mechanism to write a String to a file
|
String getReceivedFileName(Message msg)
msg
- the message of which the received file name to be fetchedString getReceivedFilePath(Message msg)
msg
- the message of which the received file path to be fetchedvoid setFileName(Message msg, String fileName)
msg
- the message to which the file name will be setfileName
- the file name to be setInputStream readFile(String fileURL) throws FileNotFoundException
fileURL
- the file URL to be readFileNotFoundException
- if the file cannot be locatedString readTextFile(String fileURL) throws IOException
fileURL
- the file URL from which the file to be readIOException
- if the file cannot be located or readvoid writeTextFile(String fileURL, String content) throws IOException
fileURL
- the file URL to which the payload should be writtencontent
- the String content to be written to the fileIOException
- if the file cannot be located or writtenvoid storeMessage(Message msg, String filePath) throws IOException
msg
- the message to be stored into a filefilePath
- the path of the file to be used in storing the given messageIOException
- if the file to be written cannot be located nor has permission issuesCollection<File> listFiles(String fileURL)
fileURL
- the file path of which the children files to be listedCopyright © 2010–2016 AdroitLogic. All rights reserved.