commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37404] New: - AbstractFileConfiguration.getFile() returns incorrect file object
Date Tue, 08 Nov 2005 15:33:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37404>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37404

           Summary: AbstractFileConfiguration.getFile() returns incorrect
                    file object
           Product: Commons
           Version: 1.1.0
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: pds1602@yahoo.co.uk


This is true of all file operations, such as getPath() etc.

Running from Netbeans 5.0 beta:

I have a configuration file called mcc.properties that is located under the
default package under source packages in NB. When I unit test this, it reads the
configuration file correctly but when I add an item and save it, it creates a
new file under the project directory. Adding a few println statements, I find
that the  File object returned by getFile() is not the file object that could
have been used to load my properties file because its pointing to a different
file altogether.

So, netbeans puts its output, after compilation, under a directory called
'framework/build/classes' where framework is my top level directory. My
properties file is located in the classes directory,
'framework\build\classes\mcc.properties'. After I load it in junit and do a
config.getPath () it returns 'framework\mcc.properties' as the location of my
file, which is wrong. If I do some additions to the property file and save it,
it saves it in 'framework\mcc.properties' so I land up with two property files.

It seems this file handling stuff is done in AbstractFileConfiguration so I
guess the problem is in there.

//loads from framework\build\classes\mcc.properties
config = new PropertiesConfiguration("mcc.properties");
            
System.out.println("FileName: " + config.getPath ());
//returns framework\mcc.properties - WRONG!

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message