|
Re: How to - Open XML file for reading from within plugin install location. [message #768219 is a reply to message #767113] |
Mon, 19 December 2011 14:25  |
Eclipse User |
|
|
|
I found a way to do it. Just in case anyone else is curious on how to do it I'll post the snippet below:
// This gives us /updateSites.xml
URL url = Activator.getDefault().getBundle().getEntry("updateSites.xml");
// This gives us /home/username/.../updateSites.xml
URL absoluteURL = absoluteURL = FileLocator.resolve(url);
// Now create the file
File file = new File(absoluteURL.getFile());
// The file reader
FileReader reader = new FileReader(file);
// Now create the memento
IMemento memento = memento = XMLMemento.createReadRoot(reader);
There you have it! I haven't tried to use a FileWriter; however, I'm pretty sure this is a read only directory.
|
|
|
Powered by
FUDForum. Page generated in 0.05720 seconds