You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/12/17 17:25:34 UTC

[commons-net] branch master updated (c7e5a4c -> 53d9fd4)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git.


    from c7e5a4c  Javadoc.
     new e208cbb  Remove trailing spaces.
     new 53d9fd4  Eat own dog food.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/apache/commons/net/ftp/FTP.java       |  2 +-
 src/main/java/org/apache/commons/net/ftp/FTPClient.java | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)


[commons-net] 02/02: Eat own dog food.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git

commit 53d9fd41073141a0a9cb5761cbde8fc3e9fe5dd6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 17 12:25:30 2020 -0500

    Eat own dog food.
---
 src/main/java/org/apache/commons/net/ftp/FTPClient.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/net/ftp/FTPClient.java b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
index cda4ceb..f22f6ae 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
@@ -3598,7 +3598,8 @@ implements Configurable
      */
     public String getModificationTime(final String pathname) throws IOException {
         if (FTPReply.isPositiveCompletion(mdtm(pathname))) {
-            return getReplyStrings()[0].substring(4); // skip the return code (e.g. 213) and the space
+            // skip the return code (e.g. 213) and the space
+            return getReplyStrings()[0].substring(4);
         }
         return null;
     }
@@ -3617,12 +3618,12 @@ implements Configurable
      * @since 3.4
      */
     public FTPFile mdtmFile(final String pathname) throws IOException {
-        if (FTPReply.isPositiveCompletion(mdtm(pathname))) {
-            final String reply = getReplyStrings()[0].substring(4); // skip the return code (e.g. 213) and the space
+        final String modificationTime = getModificationTime(pathname);
+        if (modificationTime != null) {
             final FTPFile file = new FTPFile();
             file.setName(pathname);
-            file.setRawListing(reply);
-            file.setTimestamp(MLSxEntryParser.parseGMTdateTime(reply));
+            file.setRawListing(modificationTime);
+            file.setTimestamp(MLSxEntryParser.parseGMTdateTime(modificationTime));
             return file;
         }
         return null;


[commons-net] 01/02: Remove trailing spaces.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git

commit e208cbba34c855660539f5a006daab9477cf4f9a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 17 12:25:24 2020 -0500

    Remove trailing spaces.
---
 src/main/java/org/apache/commons/net/ftp/FTP.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/net/ftp/FTP.java b/src/main/java/org/apache/commons/net/ftp/FTP.java
index 0e5e105..871808f 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTP.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTP.java
@@ -1375,7 +1375,7 @@ public class FTP extends SocketClient
 
     /**
      * Sends the MDTM command for the given file.
-     * 
+     *
      * @param file name of file
      * @return the status
      * @throws IOException on error