commit | 6f254e5e71609487a6dc99b2858252569039abd4 | [log] [tgz] |
---|---|---|
author | Sebastian Bazley <sebb@apache.org> | Tue Feb 07 14:39:59 2017 +0000 |
committer | Sebastian Bazley <sebb@apache.org> | Tue Feb 07 14:39:59 2017 +0000 |
tree | 250d4208c6bf0e2fab894331b45d70324f6b1cee | |
parent | cd299336abb873f53664063e0a977650f22fe8f3 [diff] |
mdtmFile can return null git-svn-id: https://svn.apache.org/repos/asf/commons/proper/net/trunk@1782001 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/examples/ftp/FTPClientExample.java b/src/main/java/examples/ftp/FTPClientExample.java index 79af91e..c633558 100644 --- a/src/main/java/examples/ftp/FTPClientExample.java +++ b/src/main/java/examples/ftp/FTPClientExample.java
@@ -410,8 +410,12 @@ } 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);