Name: scala-ftp
Owner: Futurice
Description: FTP library for Scala
Forked from: vrcod/scala-ftp
Created: 2017-08-10 08:05:57.0
Updated: 2017-08-10 08:05:58.0
Pushed: 2017-08-10 09:08:31.0
Homepage: null
Size: 106
Language: Scala
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A small library for working with FTP in Scala
ct E {
private val client: FTP = FTPClient() // create a new FTP client instance
def downloadFileExample() : Unit = {
client.connectWithAuth("ftp.mozilla.org", "anonymous", "")
client.cd("pub")
//Download file
if (client.filesInCurrentDirectory.contains("README")) {
client.downloadFile("README")
}
client.disconnect()
}
def uploadFileExample() : Unit = {
client.connectWithAuth("ftp.mozilla.org", "anonymous", "")
client.cd("pub")
//Upload file
if (client.filesInCurrentDirectory.contains("README")) {
val fileStream: InputStream = ftp.downloadFileStream("README")
client.uploadFile("README_REUPLOADED", fileStream)
}
client.disconnect()
}