Code example for Attributes

Methods: getValueput

0
	/** Remove the jar file to the classpath in the MANIFEST.MF file */  
    protected void updateClasspath(Manifest manifest) throws DeployException {
       	Attributes mainAttributes = manifest.getMainAttributes();
    	String classpath = null; 
        if (mainAttributes != null) {
        	classpath = mainAttributes.getValue(Attributes.Name.CLASS_PATH);
        } 
         
        String newJar = getJarFileNameWithDotSlash();
		String newClasspath = null;
    	if ( classpath != null ) {
    		newClasspath = StringUtils.replace(classpath,newJar,"");
   			mainAttributes.put(Attributes.Name.CLASS_PATH,newClasspath);
   			if ( classpath.length() < newClasspath.length() ) {
   				System.out.println("Removed "+newJar+" from classpath");
   			} 
    	} 
    } 
  
     
Connect your IDE to all the code out there  Get Codota for Java