Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ public class SpeedTestConst {
/**
* default username for FTP download/upload.
*/
public static final String FTP_DEFAULT_USER = "anonymous";
public static String FTP_DEFAULT_USER = "anonymous";

/**
* default password for FTP download/upload.
*/
public static final String FTP_DEFAULT_PASSWORD = "";
public static String FTP_DEFAULT_PASSWORD = "";

/**
* Chunk to write at each iteration for upload file generation.
Expand Down
18 changes: 18 additions & 0 deletions jspeedtest/src/main/java/fr/bmartel/speedtest/SpeedTestSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,24 @@ public void startDownload(final String uri) {
mTask.startDownloadRequest(uri);
}

/**
* Start download process.
*
* @param uri uri to fetch to download file
* @param username username
* @param password password
* @param maxDuration max duration for download
* @param reportInterval report time interval
*/
@Override
public void startDownload(final String uri, final String username, final String password, final int maxDuration, final int reportInterval) {
initReportTask(reportInterval);
mTask.setReportInterval(true);
SpeedTestConst.FTP_DEFAULT_USER = username;
SpeedTestConst.FTP_DEFAULT_PASSWORD = password;
startFixedDownload(uri, maxDuration);
}

/**
* Set proxy server for all DL/UL tasks.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ public interface ISpeedTestSocket {
*/
void startDownload(String uri);

/**
* Start download process.
*
* @param uri uri to fetch to download file
* @param username username of ftp
* @param password password of ftp
* @param maxDuration maxDuration for download file
* @param reportInterval report Interval
*/
void startDownload(final String uri,String username,String password,int maxDuration,int reportInterval);

/**
* Add a speed test listener to list.
Expand Down