protected void resetClassPath(List cp) { ArchiveManifest mf = outgoingArchive.getManifest(); if (cp.isEmpty()) mf.getMainAttributes().remove(Attributes.Name.CLASS_PATH); else { mf.setClassPath("");//$NON-NLS-1$ for (int i = 0; i < cp.size(); i++) { mf.appendClassPath((String) cp.get(i)); } } }
/** * Sets the Class-path manifest entry, rebuilds the class loader, and refreshes any reflected * java classes */ public void setManifestClassPathAndRefresh(String classpath) { ArchiveManifest mf = getManifest(); if (manifest == null) { makeManifest(); } mf.setClassPath(classpath); //Optimization - only re init if a cl exists; otherwise it will init on // demand if (archiveClassLoader != null) initializeClassLoader(); }
manifest.setClassPath(cpBuffer.toString()); manifest.write(outputStream); outputStream.flush();
/** * Updates the manifest Class-Path:, and sends out a notification of type * {@link ClasspathModelEvent#CLASS_PATH_CHANGED} */ public void updateManifestClasspath() { if (classPathSelection != null && classPathSelection.isModified()) { manifest.setClassPath(classPathSelection.toString()); fireNotification(new ClasspathModelEvent(ClasspathModelEvent.CLASS_PATH_CHANGED)); } }
public IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) throws ExecutionException { IFile file = (IFile)model.getProperty(UpdateManifestDataModelProperties.MANIFEST_FILE); String classPathValue = model.getStringProperty(UpdateManifestDataModelProperties.JAR_LIST_TEXT_UI); try { ArchiveManifest mf = J2EEProjectUtilities.readManifest(file); if (mf == null) mf = new ArchiveManifestImpl(); mf.addVersionIfNecessary(); if (model.getBooleanProperty(UpdateManifestDataModelProperties.MERGE)) { mf.mergeClassPath(ArchiveUtil.getTokens(classPathValue)); } else { mf.setClassPath(classPathValue); } if (model.isPropertySet(UpdateManifestDataModelProperties.MAIN_CLASS)) { mf.setMainClass(model.getStringProperty(UpdateManifestDataModelProperties.MAIN_CLASS)); } J2EEProjectUtilities.writeManifest(file, mf); } catch (java.io.IOException ex) { throw new ExecutionException(ex.getMessage(),ex); } return OK_STATUS; }
mf.addVersionIfNecessary(); if (replace) mf.setClassPath(classPathValue); else mf.mergeClassPath(ArchiveUtil.getTokens(classPathValue));