commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CONFIGURATION-300) Can not create a PropertiesConfiguration if the filename contains a '#'
Date Tue, 27 Nov 2007 21:31:43 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546008
] 

Oliver Heger commented on CONFIGURATION-300:
--------------------------------------------

The problem does not seem to be the fileFromURL() method, but the URL returned by File.toURL()
is already incorrect because the "#" character should have been escaped. We have hit a bug
in the JDK here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532

I tend to close this issue as WONT FIX because this is a problem of the JDK with no really
satisfying workaround (at least according to the discussion in the ticket mentioned above)
. In the future we will probably implement a different mechanism for specifying configuration
files based on so-called locators (see CONFIGURATION-153). With this approach the problem
can be solved.

WDYT?

> Can not create a PropertiesConfiguration if the filename contains a '#'
> -----------------------------------------------------------------------
>
>                 Key: CONFIGURATION-300
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-300
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Windows 2000
>            Reporter: Jean-Fran├žois Lecomte
>            Priority: Minor
>             Fix For: 1.6
>
>
> It is not possible to load a properties file if there is a '#' in the filename.
> To reproduce:
>     public static void main(String[] args) throws Exception
>     {
>         File file = new File("myProperties #1.properties");
>         try
>         {
>             file.createNewFile();
>             
>             Configuration configuration = new PropertiesConfiguration(file);
>         }
>         catch (Exception e)
>         {
>             e.printStackTrace();
>         }
>         finally
>         {
>             file.delete();
>         }
> }
> The method that drops the '#' is : ConfigurationUtils.fileFromURL...

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


Mime
View raw message