commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1782001 - /commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
Date Tue, 07 Feb 2017 14:40:00 GMT
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);



Mime
View raw message