| 
| Re: transform a ZipEntry to an EMF Resource [message #322248 is a reply to message #322247] | 
Mon, 12 November 2007 03:38   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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); 
		} 
	}
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.03803 seconds