Uwe Schindler created TIKA-1758:
-----------------------------------

             Summary: BatchCommandLineBuilder fails on systems with whitespace 
in path
                 Key: TIKA-1758
                 URL: https://issues.apache.org/jira/browse/TIKA-1758
             Project: Tika
          Issue Type: Bug
          Components: cli
            Reporter: Uwe Schindler


All tests for CLI module fail with errors like that:

{noformat}
Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.048 sec <<< 
FAILURE! - in org.apache.tika.cli.TikaCLIBatchCommandL
ineTest
testTwoDirsNoFlags(org.apache.tika.cli.TikaCLIBatchCommandLineTest)  Time 
elapsed: 0.026 sec  <<< ERROR!
java.nio.file.InvalidPathException: Illegal char <"> at index 0: "C:\Users\Uwe 
Schindler\Projects\TIKA\svn\tika-app\testInput"
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at 
org.apache.tika.cli.BatchCommandLineBuilder.translateCommandLine(BatchCommandLineBuilder.java:137)
        at 
org.apache.tika.cli.BatchCommandLineBuilder.build(BatchCommandLineBuilder.java:51)
        at 
org.apache.tika.cli.TikaCLIBatchCommandLineTest.testTwoDirsNoFlags(TikaCLIBatchCommandLineTest.java:127)
{noformat}

The reason is that BatchCommandLineBuilder adds quotes for unknown reasons!? If 
you use ProcessBuilder you don't need that! Not sure what this should do, but 
the problem is: The first argument (the executable) contains quotes afterwards 
and breaks the test.

I have no idea how to fix this, but the quotes should not be in a String[] 
command line at all.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to