diff --git a/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java b/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java index a3b2a9279..a6badea69 100644 --- a/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java +++ b/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java @@ -30,6 +30,12 @@ * This class is based on the logic of Daniel Savarese's DefaultFTPListParser, but adapted to use regular expressions and to fit the new FTPFileEntryParser * interface. *
+ *+ * By default, leading spaces in parsed file names are preserved because Unix file names may legitimately begin with spaces. However, some FTP servers, + * including IBM i (formerly OS/400) systems that return Unix-style listings, pad the date field with additional spaces when displaying a year instead + * of a time for older entries. As a result, parsed file names may incorrectly include a leading space. To remove these unintended spaces, use the + * {@link #UnixFTPEntryParser(FTPClientConfig, boolean)} constructor with {@code trimLeadingSpaces} set to {@code true}. + *
* * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions) */