[ 
http://issues.apache.org/jira/browse/CONFIGURATION-246?page=comments#action_12460341
 ] 
            
Oliver Heger commented on CONFIGURATION-246:
--------------------------------------------

How did you initialize the configuration? Looking at the code in 
AbstractFileConfiguration the return value of getBasePath() seems to depend on 
the way the location of the configuration file was set. I think it is not true 
that getBasePath() always returns a full path. For instance in the setFile() 
and setURL() methods the base path is correctly set to the directory, to which 
the configuration file belongs.

Renaming the method is not an option because we have to ensure backwards 
compatibility. Besides there is already a getPath() method in 
AbstractFileConfiguration.

Maybe there are just too many ways of setting the file's location. But this is 
something we cannot change now either.

> The method getBasePath() in FileConfiguration suggest other behavior than it 
> is implemented
> -------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-246
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-246
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Thomas Wabner
>
> I have tried to use the FileConfiguration#getBasePath method without a look 
> into the implementation. The documentation is not very useful because it says 
> simple "returns the base path". For me the method suggest that a string for 
> the configuration file "C:\myDir\config.file" in form "C:\myDir\" is 
> returned. But the method returns the full path.
> I suggest to rename the method to getPath and give a documentation link to 
> URL#getPath which does in fact the same. Or update the documentation which 
> describes in more detail that this method returns the complete path for the 
> associated file for this file configuration.
> A documentation entry can then looks like
> Returns the base path for the file associated with the current file 
> configuration. The base path contains the full path to the file and the file 
> itself.
> @see java.net.URL#getPath

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to