Deleting resources from workspace [message #59543] |
Mon, 02 June 2003 14:07 |
Eclipse User |
|
|
|
Originally posted by: pkrishnan.indus.com
Greetings
I have written a Import and Export wizard that imports a file and creates
a serialized object of the imported file then saves that in the workspace.
The export wizard creates a original import file from the serialized
object file. One of the things that export wizard does after writing the
file is to delete the serialized object file from the workspace. While
the import and export functions work as designed, the serialized object
file gets deleted sometimes and most of the times it is not deleted. I
followed some of the threads on this message board providing suggestions
to solve this problem. It did not help. I would like to delete the
serialized object file after the export always.
I tried using eclipse resource delete methods for deleting the resources
from workspace as well as tried the java.io.File delete method. I made
sure that any markers on the file that I want to delete are deleted
before I delete the file. Also, I sprinkled the refreshLocal method
liberally before and after the export and delete. From what I saw from
the message board about not deleting the resources is due to windows
holding a handle on the file and some suggested that may be the file was
open in another window or something that blocked the file from getting
deleted. I made sure that I did not have another window open while I ran
the export wizard. Also, I made sure that any io streams that we used to
create the serialized object file are closed. This may be a bug in
eclipse. The point to note here is, we could delete the original input
file from which we created a copy of the input file in the work space with
the same name and extension. Serialized object file does not exist in the
import directory to begin with, but is created afresh in the workspace
during import by the import process. I don't know if there is any
underlying links that the eclipse runtime holds about the file being
imported into workspace with the same name versus the file created by the
import wizard with a different name and content(aka serialized object
file). If i import a file with an extension .sym into workspace, the
import process creates a serialized object file with an extension .sso in
the workspace. It seems sometimes, when the stars are good and no lunar
eclipse in the horizon, the serialized object file gets deleted by the
export process. Has anyone run into this problem?. Let me know how you
resolve it.
Thanks for your time, sorry about the long message.
Krishnan
|
|
|
Powered by
FUDForum. Page generated in 0.03499 seconds