You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2010/04/02 19:20:27 UTC

[jira] Created: (TIKA-398) TestParsers fails when classpathh contains special characters like spaces

TestParsers fails when classpathh contains special characters like spaces
-------------------------------------------------------------------------

                 Key: TIKA-398
                 URL: https://issues.apache.org/jira/browse/TIKA-398
             Project: Tika
          Issue Type: Bug
          Components: parser
    Affects Versions: 0.7
         Environment: Windows 7 with space in username and running tests in home dir
            Reporter: Uwe Schindler
            Priority: Minor
         Attachments: TIKA-398.patch

The test TestParsers has the same problem like some Lucene tests in the past and also SolrInfoMBeanTest:
If you want to get a File instance from the classpath and you use Class.getResource(), the return value is URL. If you call getFile() or getPath() on this URL, the returned String is just the File/Path part of the URL, which may contain url escaping ("%20" for spaces).

The correct way to get File instances from getResource() URLs is to cast it to an URI and use the File ctor that takes URIs. This is the "official" way as described in Java docs and various forums.

Attached is a trivial patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TIKA-398) TestParsers fails when classpathh contains special characters like spaces

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann updated TIKA-398:
-----------------------------------

    Fix Version/s: 0.8

- schedule for 0.8

> TestParsers fails when classpathh contains special characters like spaces
> -------------------------------------------------------------------------
>
>                 Key: TIKA-398
>                 URL: https://issues.apache.org/jira/browse/TIKA-398
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.7
>         Environment: Windows 7 with space in username and running tests in home dir
>            Reporter: Uwe Schindler
>            Assignee: Chris A. Mattmann
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: TIKA-398.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> The test TestParsers has the same problem like some Lucene tests in the past and also SolrInfoMBeanTest:
> If you want to get a File instance from the classpath and you use Class.getResource(), the return value is URL. If you call getFile() or getPath() on this URL, the returned String is just the File/Path part of the URL, which may contain url escaping ("%20" for spaces).
> The correct way to get File instances from getResource() URLs is to cast it to an URI and use the File ctor that takes URIs. This is the "official" way as described in Java docs and various forums.
> Attached is a trivial patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TIKA-398) TestParsers fails when classpathh contains special characters like spaces

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated TIKA-398:
-------------------------------

    Attachment: TIKA-398.patch

> TestParsers fails when classpathh contains special characters like spaces
> -------------------------------------------------------------------------
>
>                 Key: TIKA-398
>                 URL: https://issues.apache.org/jira/browse/TIKA-398
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.7
>         Environment: Windows 7 with space in username and running tests in home dir
>            Reporter: Uwe Schindler
>            Priority: Minor
>         Attachments: TIKA-398.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> The test TestParsers has the same problem like some Lucene tests in the past and also SolrInfoMBeanTest:
> If you want to get a File instance from the classpath and you use Class.getResource(), the return value is URL. If you call getFile() or getPath() on this URL, the returned String is just the File/Path part of the URL, which may contain url escaping ("%20" for spaces).
> The correct way to get File instances from getResource() URLs is to cast it to an URI and use the File ctor that takes URIs. This is the "official" way as described in Java docs and various forums.
> Attached is a trivial patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TIKA-398) TestParsers fails when classpathh contains special characters like spaces

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann reassigned TIKA-398:
--------------------------------------

    Assignee: Chris A. Mattmann

> TestParsers fails when classpathh contains special characters like spaces
> -------------------------------------------------------------------------
>
>                 Key: TIKA-398
>                 URL: https://issues.apache.org/jira/browse/TIKA-398
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.7
>         Environment: Windows 7 with space in username and running tests in home dir
>            Reporter: Uwe Schindler
>            Assignee: Chris A. Mattmann
>            Priority: Minor
>         Attachments: TIKA-398.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> The test TestParsers has the same problem like some Lucene tests in the past and also SolrInfoMBeanTest:
> If you want to get a File instance from the classpath and you use Class.getResource(), the return value is URL. If you call getFile() or getPath() on this URL, the returned String is just the File/Path part of the URL, which may contain url escaping ("%20" for spaces).
> The correct way to get File instances from getResource() URLs is to cast it to an URI and use the File ctor that takes URIs. This is the "official" way as described in Java docs and various forums.
> Attached is a trivial patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TIKA-398) TestParsers fails when classpathh contains special characters like spaces

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann resolved TIKA-398.
------------------------------------

    Resolution: Fixed

- patch committed in r930950, all tests pass on my Mac OS X 10.5.6. Thanks, Uwe!

> TestParsers fails when classpathh contains special characters like spaces
> -------------------------------------------------------------------------
>
>                 Key: TIKA-398
>                 URL: https://issues.apache.org/jira/browse/TIKA-398
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.7
>         Environment: Windows 7 with space in username and running tests in home dir
>            Reporter: Uwe Schindler
>            Assignee: Chris A. Mattmann
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: TIKA-398.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> The test TestParsers has the same problem like some Lucene tests in the past and also SolrInfoMBeanTest:
> If you want to get a File instance from the classpath and you use Class.getResource(), the return value is URL. If you call getFile() or getPath() on this URL, the returned String is just the File/Path part of the URL, which may contain url escaping ("%20" for spaces).
> The correct way to get File instances from getResource() URLs is to cast it to an URI and use the File ctor that takes URIs. This is the "official" way as described in Java docs and various forums.
> Attached is a trivial patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.