sebbASF commented on code in PR #95:
URL: https://github.com/apache/commons-net/pull/95#discussion_r1024318435


##########
src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java:
##########
@@ -203,6 +203,20 @@ public void testParseFieldsOnFile() throws Exception
                      df.format(f.getTimestamp().getTime()));
     }
 
+    /**
+     * Method testParseFileNameWithSpaces.
+     * Provide a test to show that file which name contains spaces is parsed 
correctly.
+     * @throws Exception on error
+     */
+
+    public void testParseFileNameWithSpaces() throws Exception
+    {
+        final FTPFile f = getParser().parseFTPEntry("MYUSER              3 
06/12/21 12:00:00 *STMF      file with space.txt");
+        assertNotNull("Could not parse entry.", f);
+        assertTrue("Should have been a file.", f.isFile());
+        assertEquals("file with space.txt", f.getName());

Review Comment:
   It should be easy enough to handle embedded and trailing spaces.
   However leading spaces can only be detected if the filename always starts in 
a specific column.
   
   This needs to be determined by experimentation on OS400, or by finding the 
appropriate documentation for OS400.
   I cannot personally help with that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to