java.io.File and properties

Ranjit Mathew rmathew4lists@hotmail.com
Fri May 9 14:39:00 GMT 2003


> The above from Sun looks stupid.  At what point is it useful to allow
> programmer's to modify tmpdir at runtime but not let that change the
> way createTempFile works?  I guess we can be bug compatible here, but
> we may need a gnu.java.io.File.getTempDir() that works better.

BTW, I should note that the output is unchanged if I use
System.setProperty( ) instead of put( ).

Similarly, 'new File( ".").listFiles( )' is unaffected by
any value I set for "user.dir".

So a System.setProperty( ) either should not be allowed
for such properties, or should be considered as a directive
and reflected "as appropriate" throughout the running JVM 
instance.

System.getProperties( ) should just return a *clone* of the
"actual" Properties object (and documented as such) - or 
either a "read-only" wrapper around the "actual" Properties 
or one with an appropriately overridden put( ).

For the time being however, we will just have to ape 
Sun's behaviour. :-(

Ranjit.

PS: Michael, your mailer sends a separate message each to the
"From:" and "Reply-To:" addresses (instead of just the latter)
and as a result I get *three* messages when you reply,
exacerbated further when someone does a subsequent "Reply-All".



More information about the Java mailing list