Skip to content

victrcodes/scala-ftp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala FTP

A small library for working with FTP in Scala

object 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()

	}

}

About

FTP library for Scala

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%