You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/11/14 19:54:40 UTC

[GitHub] [commons-net] garydgregory commented on a diff in pull request #95: NET-707: Process files with spaces in name for OS400

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


##########
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:
   How can you tell `"file with space.txt"` from `" file with space.txt"` from `"file with space.txt "`?



-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org