Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » transform a ZipEntry to an EMF Resource
transform a ZipEntry to an EMF Resource [message #322247] Mon, 12 November 2007 02:38 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,


I would like to know how can I do to tell a zipentry it's a emf Resource.

If that possible .

Thanks
Re: transform a ZipEntry to an EMF Resource [message #322248 is a reply to message #322247] Mon, 12 November 2007 03:38 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Simply by using load

/**
* Read the specified jar file to search and load the selected file.
*
* @param entry
* The classpath entry
*/
private void readJarEntries(IJavaProject project, IClasspathEntry entry) {
try {
URL url = new URL("jar:file:/" + entry.getPath().toString() + "!" +
removeProtocol());
ArchiveURLConnection urlConnection = new ArchiveURLConnection(url);
InputStream input = urlConnection.getInputStream();
if (input != null) {
found = true;
XMIIDResourceImpl resource = new XMIIDResourceImpl();
resource.load(input, null);
}

}catch (MalformedURLException ex) {
Logger.error("Malformed url exception : " + ex);
}catch (IOException ex) {
Logger.error("IOException : " + ex);
}
}
Previous Topic:ReferenceCounter public alternative
Next Topic:Refresh annotations
Goto Forum:
  


Current Time: Fri Jul 18 05:55:36 EDT 2025

Powered by FUDForum. Page generated in 0.08506 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top