Skip to content

Server Communication

Willi Bölke edited this page Jun 2, 2020 · 8 revisions

In General

The Package ServerCommunication contains all Classens wich directly communicates with the the Server

FtpClient

Wraps the Apache FTPClient to our needs.

Methods

Name Returns Parameters Description
connect() 0 = success 1 = Server refused connection 2 = SocketException 3 = IOException connects to the server sepecified in Variables
isConnected() true = connected false = not connected returns if the instannce is connected
closeConnection() void closes the connection
getDirList(String path) FTPFile[] which contains all directories in path the path Retrieves all directories in path from the FTPServer
getFileList(String path) FTPFile[] which contains all files in path the pah Retrieves all files in path from the FTPServer
getAllFilesList(String path) FTPFile[] which contains all files in path the path Retrieves all files in path and includes files from sub dirs
downloadFile(String remoteFileName, String downloadPath) true = success false = not successfull remoteFileName = the name of the file to be downloaded, downloadPath = the directory path downloads a file from the FTPServer and writes it to the device local storage

FtpTaskDirListing

Lists directories hosted on FTP Remote Server.

FtpTaskFileListing

Lists files hosted on FTP Remote Server

FtpTaskFileDownloading

Downloads files from FTP Remote Server

Variables

Contains all needed information about the Server such as IP address, ports and (ftp) user ingerdients. You need to chane the in case you host your own Server on a different location.

Download:

Clone this wiki locally