RE: NPE in getRemoteAdress

2016-08-28 Thread Martin Gainty
where is connectionInfo initialised? -M > To: user@commons.apache.org > From: oliver.zem...@gmail.com > Subject: NPE in getRemoteAdress > Date: Sun, 28 Aug 2016 15:50:36 +0200 > > Hi > > i am trying to get some files from a FTP Server. When i use > retrieveFile(), it works, but i would like

NPE in getRemoteAdress

2016-08-28 Thread Oliver Zemann
Hi i am trying to get some files from a FTP Server. When i use retrieveFile(), it works, but i would like to add some listeners to it (how many bytes got transfered etc.) so i used retrieveFileStream(). Now i get some exceptions and no files are downloaded. This is the part of the code:

Re: NPE in getRemoteAdress

2016-08-28 Thread Oliver Zemann
ConnectionInfo is a JAXB Bean. I just have seen that thunderbird messed up some lines during copy/paste The connectionInfo is fully initialized, here is a short part of it: public class ConnectionInfo { @XmlElement(name = "Name") private String name; @XmlElement(name = "Host") private String

Re: NPE in getRemoteAdress

2016-08-28 Thread Bernd Eckenfels
Hello, I am not sure about your NPE, but this code here ignores the result of the read call. It cannot deal with short reads: Am Sun, 28 Aug 2016 15:50:36 +0200 schrieb Oliver Zemann : > byte b[] =new byte[4096]; > while (inputStream.read(b) != -1) { > fos.write(b); >

RE: NPE in getRemoteAdress

2016-08-28 Thread Martin Gainty
possible timeout waiting for FTP to reply examples.ftp.FTPClientExample says to increase FTP reply timeout with -w parameter if (args[base].equals("-w")) {controlKeepAliveReplyTimeout = Integer.parseInt(args[++base]);} or with