commons-issues mailing list archives

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

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

Alexey Panchenko commented on CONFIGURATION-300:
------------------------------------------------

http://java.sun.com/javase/6/docs/api/java/io/File.html#toURL()

File.toURL() is deprecated
File.toURI().toURL() should be used instead.

> 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