bertrandmartel / speed-test-lib

:cloud: JSpeedTest : speed test client library for Java/Android
MIT License
381 stars 119 forks source link

start***Download & start***Upload overrides with FTP account params #40

Closed gdamich closed 7 years ago

gdamich commented 7 years ago

So as title says, could you please override mentioned methods so that we can use lib on custom FTP servers with appropriate FTP account credentials, not with Constant class you build in lib. So like:

startFixedDownload(java.lang.String uri, int maxDuration, int reportInterval, String ftpUsername, String ftpPassword) where uri is with ftp:// protocol prefix.

Best, G

bertrandmartel commented 7 years ago

userInfo data is parsed in the URI, it can be used as

speedTestSocket.startFixedDownload("ftp://username:password@your.server.net/100MB.zip");

This must be a valid URI scheme as :

ftp:[//[user[:password]@]host[:port]][/path]

An example of ftp server with credentials tested is

ftp://speedtest:speedtest@ftp.otenet.gr/test1Mb.db
bertrandmartel commented 7 years ago

Note that the default is anonymous authentication (user : anonymous, no password)