View Full Version : Perl to Java translation

12-15-2007, 07:39 PM
What is the java equivalent of the following perl code?

use strict;
use warnings;
use Net::FTP;

my $file = shift;
my $server = 'domain.com'; (edited out)
my $username = 'username'; (edited out)
my $password = 'password'; (edited out)

my $remote_dir = 'domain.com'; (edited out)

my $ftp = Net::FTP->new($server) or die "can't connect to $server: $@";
$ftp->login($username, $password) or die "can't login ", $ftp->message;
$ftp->cwd($remote_dir) or die "can't cd to $remote_dir ", $ftp->message;
$ftp->put($file) or die "can't transfer $file", $ftp->message;
exit 1;Thank you!

12-15-2007, 08:52 PM
This is a java binding for curl, another ftp client, with many future.


Still you can deal with java programming, I think it's easy to use this
in your application.

best regards

12-15-2007, 09:35 PM
got it figured out. never mind. Thanks anyway!:thumbsup: