Java Requires Chilkat v9.5.0.89+
Chilkat2 Java
Wasabi FTP Download
See more Wasabi Examples
Demonstrates how to download a file from a Wasabi bucket using FTP.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Ftp2;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Ftp2 ftp = new Ftp2();
// Use the domain for the bucket you'll be managing.
ftp.setHostname("s3.s3.us-west-1.wasabisys.com");
// Use your root account username (email address) and root account password
ftp.setUsername("root_account_username");
ftp.setPassword("root_account_password");
ftp.setSsl(true);
ftp.setPort(990);
try {
ftp.connect();
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
// Upload a file (starfish.jpg) to the bucket named "chilkat"
String localFilePath = "qa_output/starfish.jpg";
String remoteBucketPath = "/chilkat/starfish.jpg";
try {
ftp.getFile(remoteBucketPath, localFilePath);
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
System.out.println("File uploaded.");
}
}