> I am basically attempting the following:
>
[quoted text clipped - 9 lines]
>
> Any ideas?
What happens if you try it in a shell
mv /opt/OldDirectoryName /opt/NewDirectoryName
? Do you get an error message from the shell?
I would guess, you'll get something like "permission denied", because the
operation requires write-access to the /opt directory.

Signature
"TFritsch$t-online:de".replace(':','.').replace('$','@')
JScoobyCed - 12 Apr 2006 02:43 GMT
>> if ( oldName.renameTo( newName ) )
>> // Successfully renamed
[quoted text clipped - 10 lines]
> I would guess, you'll get something like "permission denied", because the
> operation requires write-access to the /opt directory.
It's a good suggestion, but not necessary the right thing. I got similar
problem on FreeBSD (ok, Mac OS X :) ). I could rename or move or delete
my file with the shell command line, but not from Java File.renameTo(File)
Unfortunately at that time I was in a hurry to close the project and did
"the dirty Harry way" (shame on me):
FileInputStream on the oldFile
FileOutputStream on the new file
read from old file arrays of byte[] and write them to the output.
It has the advantage of working, but in term of performances, it is
really bad. My project didn't need performance, so it was ok, but...

Signature
JSC
ebresie@gmail.com - 12 Apr 2006 17:25 GMT
Does that work for directories as well?
I'm not really up on java security configuration processes, but could
this in any way have to do with security policy for my java
environment?
Eric
Thomas Fritsch - 12 Apr 2006 17:56 GMT
ebresie@gmail.com schrieb:
> Does that work for directories as well?
>
> I'm not really up on java security configuration processes, but could
> this in any way have to do with security policy for my java
> environment?
If renameFile() fails because of java security, then you would get a
SecurityException. If it fails because of another reason (OS denies
permission), then you get "false" as return-value. So you can
distinguish between these causes easily.

Signature
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
ebresie@gmail.com - 12 Apr 2006 17:30 GMT
Yup...this seems to be the case.
I had performed the rename step in a perl script previously, which I
was attempting to duplicated in java. The perl script was running as
root at boot time, so it did not exhibit this problem.
Eric