Questions tagged [apache-commons-net]

Apache Commons Net™ library implements the client side of many basic Internet protocols.

Protocols supported:

FTP/FTPS
NNTP
SMTP(S)
POP3(S)
IMAP(S)
Telnet
TFTP
Finger
Whois
rexec/rcmd/rlogin
Time (rdate) and Daytime
Echo
Discard
NTP/SNTP

Refer to https://commons.apache.org/proper/commons-net/ for additional information.

415 questions
0
votes
1 answer

JAVA Commons-Net FTPClient, downloading files are corrupted

I am using commans.net api in order to perform tasks e.g uploading and downloading files from the ftp server. I can perform those tasks successfully but the downloaded files are corrupted. i couldn't open those files in usual manner. please…
user2428568
  • 223
  • 1
  • 4
  • 18
0
votes
1 answer

FTPClient Connection refused

I am trying to copy file through FTPClient and testing in my local system My code is like this with my IPv4 address as input for host import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import…
Venkatesh
  • 303
  • 1
  • 10
  • 22
0
votes
2 answers

NoRouteToHostException trying to connect to remote host via org.apache.commons.net.ftp.FTPClient in SFTP mode

I'm trying to upload a file via Secure FTP with org.apache.commons.net.ftp.FTPClient but I receive "java.net.NoRouteToHostException: No route to host" when connecting. The host is pingable and I can even read/write files with my FTP user via…
Stefano Lazzaro
  • 387
  • 1
  • 4
  • 22
0
votes
2 answers

DebugException in apache-commons-net

When i try to list files from my location using ftpClient.listFiles("folder"); it shows org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array. Can…
ashokramcse
  • 2,841
  • 2
  • 19
  • 41
0
votes
1 answer

groovy.lang.GroovyRuntimeException on sending an Email

I am trying to send an email from a groovy script. I have given the code below: import org.apache.commons.net.smtp.* port = 25 org = 'mycompany.org' client = new SMTPClient() client.connect('', port) client.login() // set sender and…
Rohit Jose
  • 188
  • 3
  • 13
0
votes
1 answer

can not connect to FTPS (explicit) server with java?

I use this code to connect to ftps with explicit encryption String host = "10.21.13.66"; int port = 21; String username = "user"; String password = "pass"; try { FTPSClient ftpClient = new…
Narges
  • 1,345
  • 6
  • 14
  • 29
0
votes
1 answer

Advantage of using CopyStreamListener?

if i use the sample solution below for ftp upload/download, i can obtain the total bytes written/read from the stream to the socket buffer(correct me if i'm wrong). Compare this way of getting the bytes written/read versus using CopyStreamListener,…
ET.
  • 83
  • 1
  • 9
0
votes
1 answer

Apache FTPClient

I'm writing a very simple FTPClient application using Apache's library. All I do is download a jar file from a server. There is no exception, the application works fine when I run in on MacOS and as soon as I run the same code in Windows the…
Amir Peivandi
  • 349
  • 4
  • 19
0
votes
1 answer

Apache-Commons-Net FTPClient Wrong Port Number Computation in Active Mode

Why does Apache-Commons-Net's FTPClient sometimes make the wrong computation for the port number in the PORT command? This is in active mode. For example FTPClient it could send out PORT ,,
,,235,181 when in fact the port…
damat-perdigannat
  • 5,780
  • 1
  • 17
  • 33
0
votes
1 answer

Apache-commons-net Illegal (yet legal) CIDR notation

I need the ability to work with CIDR notation in Java. I found the commons library SubnetUtils. When I try to use a CIDR of 10.10.0.0/22, as an example I get the following Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:…
osok
  • 57
  • 7
0
votes
2 answers

Apache Commons Net - System.getProperty("line.separator") - does not work in Android

I use the Apache Commons API to append a new line to a file using the FTPClient class. When I run the following code in Java, a new line is appended to the file on the FTP server. However, when I run the same code in Android, the String is appended…
0
votes
1 answer

Apache commons java FTP upload issue

I know that there are multiple formats for ftp uploads.(Binary ascii etc…) I am writing a simple app to transfer files between my computer and a raspberry pi and I would like to know if there is a simple way to ensure that the upload is of the…
0
votes
1 answer

Downloading files from FTP

I'm trying to download files from FTP on Java using org.apache.commons. try { OutputStream os = new FileOutputStream(downloadedFile); boolean success = this.client.retrieveFile(from, os); System.out.println("File transfer…
ibm701
  • 305
  • 2
  • 11
0
votes
1 answer

java common ftpclient upload text file

I want to upload a text file on a FTP using apache commons=net 1.4.1. My code: public static void UploadTextFile(String host, String name) { try { FTPClient ftp = new FTPClient(); ftp.connect(host); int…
Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94
0
votes
1 answer

Cannot connect FTP server in java

I'm trying to develop a FTP client in java using Apache Commons Net but even if my code seems to be good I can't connect to any server and I get : java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on…
AwaX
  • 448
  • 3
  • 8
  • 19