Forum Discussion
MartinSpamer
11 years agoFrequent Contributor
Yes, this would be quite straight forward.
1) Identify a suitable Java FTP library, such Apache Common's FTPClient.
2) Add this to the SOAPUI java.library.path, which can be found using the following Groovy snippet
log.info System.properties["java.library.path"]
3) Create a Project with a Groovy Test Step
4) Code a little Groovy to perform the FTP operation you want. e.g.
import org.apache.commons.net.ftp.FTPClient
new FTPClient().with {
connect "ftp.example.com"
enterLocalPassiveMode()
login "username", "password"
changeWorkingDirectory "/blah"
def incomingFile = new File("local-filename")
incomingFile.withOutputStream { ostream -> retrieveFile "remote-filename", ostream }
disconnect()
}