whts the error message u are getting ?
first of all, can u delete the directory when the server has started ? (just hav a check)
Main Topics
Browse All Topics
I created a directory(actual) in JBoss app server's Bin directory .
I am storing image files in that directory.
I can able to read and write in to the files.
But i could not able to delete that files.
I closed all the input and outputstreams ,i used.
After i performing R/W operation i want to delete that files (Forcefully).
I need a soution for this.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I don't think you will be allowed to delete any file within the same directory in which the server has been installed without stopping the server. If you create the directory programatically for storing files temporarily then why cannot you create it on another location, outside of the server's directory? You can also create a temp-file in Java using File.createTempFile () if I remember the name correct.
maybe the jboss process lock the directory.
try a different directory for this, maybe use the temporary file API (File.createTempFile).
there is not API in java to force deletion of a file.
in fact, its an OS issue - I assume you use Windows- and in Windows, applications can lock files, and these files can't be deleted.
that is the main reason for all the windows reboots needed when installing some programs, btw.
on Linux/Unix you will not have a problem to delete the files.
> You can also create a temp-file in Java using File.createTempFile () if I remember the name correct.
http://java.sun.com/j2se/1
Business Accounts
Answer for Membership
by: CEHJPosted on 2006-03-20 at 05:05:53ID: 16234877
>>in JBoss app server's Bin directory .
Isn't that rather dangerous?