@Override public void setDefaultUseCaches(boolean defaultUseCaches) { jarURLConnection.setDefaultUseCaches(defaultUseCaches); }
@Override public void setDefaultUseCaches(boolean defaultUseCaches) { jarURLConnection.setDefaultUseCaches(defaultUseCaches); }
@Override public void setDefaultUseCaches(boolean defaultUseCaches) { jarURLConnection.setDefaultUseCaches(defaultUseCaches); }
public JarFileURLMetaDataIterator(URL url, MetaDataFilter filter) throws IOException { if (url == null) { _jarFile = null; _jarTargetEntry = null; } else { JarURLConnection jarURLConn = (JarURLConnection) url.openConnection(); jarURLConn.setDefaultUseCaches(false); try { _jarFile = AccessController.doPrivileged(J2DoPrivHelper.getJarFileAction(jarURLConn)); _jarTargetEntry = AccessController.doPrivileged(J2DoPrivHelper.getJarEntryAction(jarURLConn)); if (_jarTargetEntry.isDirectory()) { Enumeration<JarEntry> jarEntryEnum = _jarFile.entries(); while (jarEntryEnum.hasMoreElements()) { JarEntry jarEntry = jarEntryEnum.nextElement(); if (jarEntry.getName().startsWith(_jarTargetEntry.getName())) { _entryList.add(jarEntry); } } } else { _entryList.add(_jarTargetEntry); } } catch (PrivilegedActionException pae) { throw (IOException) pae.getException(); } } _filter = filter; }
public JarFileURLMetaDataIterator(URL url, MetaDataFilter filter) throws IOException { if (url == null) { _jarFile = null; _jarTargetEntry = null; } else { JarURLConnection jarURLConn = (JarURLConnection) url.openConnection(); jarURLConn.setDefaultUseCaches(false); try { _jarFile = AccessController.doPrivileged(J2DoPrivHelper.getJarFileAction(jarURLConn)); _jarTargetEntry = AccessController.doPrivileged(J2DoPrivHelper.getJarEntryAction(jarURLConn)); if (_jarTargetEntry.isDirectory()) { Enumeration<JarEntry> jarEntryEnum = _jarFile.entries(); while (jarEntryEnum.hasMoreElements()) { JarEntry jarEntry = jarEntryEnum.nextElement(); if (jarEntry.getName().startsWith(_jarTargetEntry.getName())) { _entryList.add(jarEntry); } } } else { _entryList.add(_jarTargetEntry); } } catch (PrivilegedActionException pae) { throw (IOException) pae.getException(); } } _filter = filter; }
public JarFileURLMetaDataIterator(URL url, MetaDataFilter filter) throws IOException { if (url == null) { _jarFile = null; _jarTargetEntry = null; } else { JarURLConnection jarURLConn = (JarURLConnection) url.openConnection(); jarURLConn.setDefaultUseCaches(false); try { _jarFile = AccessController.doPrivileged(J2DoPrivHelper.getJarFileAction(jarURLConn)); _jarTargetEntry = AccessController.doPrivileged(J2DoPrivHelper.getJarEntryAction(jarURLConn)); if (_jarTargetEntry.isDirectory()) { Enumeration<JarEntry> jarEntryEnum = _jarFile.entries(); while (jarEntryEnum.hasMoreElements()) { JarEntry jarEntry = jarEntryEnum.nextElement(); if (jarEntry.getName().startsWith(_jarTargetEntry.getName())) { _entryList.add(jarEntry); } } } else { _entryList.add(_jarTargetEntry); } } catch (PrivilegedActionException pae) { throw (IOException) pae.getException(); } } _filter = filter; }
public static LifecycleMappingMetadataSource getLifecycleMappingMetadataSource(CatalogItem ci) { try { URL url = getLifecycleMappingMetadataSourceURL(ci); if(url == null) { return null; } // To ensure we can delete the temporary file we need to prevent caching, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4386865 URLConnection conn = url.openConnection(); if (conn instanceof JarURLConnection) { ((JarURLConnection) conn).setDefaultUseCaches(false); } InputStream is = conn.getInputStream(); try { return LifecycleMappingFactory.createLifecycleMappingMetadataSource(is); } finally { IOUtil.close(is); } } catch(FileNotFoundException e) { // CatalogItem does not contain lifecycle mapping } catch(Exception e) { log.warn(NLS.bind(Messages.MavenCatalogViewer_Error_loading_lifecycle, ci.getId()), e); } return null; }
jarOri.setDefaultUseCaches(Resource.getDefaultUseCaches());