You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2017/02/07 14:40:00 UTC
svn commit: r1782001 -
/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
Author: sebb
Date: Tue Feb 7 14:39:59 2017
New Revision: 1782001
URL: http://svn.apache.org/viewvc?rev=1782001&view=rev
Log:
mdtmFile can return null
Modified:
commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java?rev=1782001&r1=1782000&r2=1782001&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Tue Feb 7 14:39:59 2017
@@ -410,8 +410,12 @@ __main:
}
if (mdtm) {
FTPFile f = ftp.mdtmFile(remote);
- System.out.println(f.getRawListing());
- System.out.println(f.toFormattedString(displayTimeZoneId));
+ if (f != null) {
+ System.out.println(f.getRawListing());
+ System.out.println(f.toFormattedString(displayTimeZoneId));
+ } else {
+ System.out.println("File not found");
+ }
}
if (mlst) {
FTPFile f = ftp.mlistFile(remote);