git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271244 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant.taskdefs.manifest; | |||||
| package org.apache.aut.manifest; | |||||
| import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| @@ -14,9 +14,9 @@ import java.util.jar.Attributes; | |||||
| /** | /** | ||||
| * Class to hold manifest attributes | * Class to hold manifest attributes | ||||
| * | * | ||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | |||||
| * @author <a href="mailto:conor@apache.org">Conor MacNeill</a> | * @author <a href="mailto:conor@apache.org">Conor MacNeill</a> | ||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | |||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class Attribute | public class Attribute | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant.taskdefs.manifest; | |||||
| package org.apache.aut.manifest; | |||||
| import org.apache.avalon.framework.CascadingException; | import org.apache.avalon.framework.CascadingException; | ||||
| @@ -22,7 +22,7 @@ import java.util.zip.ZipFile; | |||||
| import org.apache.aut.zip.ZipOutputStream; | import org.apache.aut.zip.ZipOutputStream; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.taskdefs.manifest.Manifest; | import org.apache.tools.ant.taskdefs.manifest.Manifest; | ||||
| import org.apache.tools.ant.taskdefs.manifest.ManifestException; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| import org.apache.tools.ant.taskdefs.manifest.ManifestUtil; | import org.apache.tools.ant.taskdefs.manifest.ManifestUtil; | ||||
| import org.apache.tools.ant.types.FileScanner; | import org.apache.tools.ant.types.FileScanner; | ||||
| @@ -13,6 +13,8 @@ import java.util.Hashtable; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Set; | import java.util.Set; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Class to manage Manifest information | * Class to manage Manifest information | ||||
| @@ -17,6 +17,8 @@ import java.util.Iterator; | |||||
| import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Class to manage Manifest information | * Class to manage Manifest information | ||||
| @@ -16,6 +16,8 @@ import java.io.UnsupportedEncodingException; | |||||
| import java.io.BufferedReader; | import java.io.BufferedReader; | ||||
| import java.util.jar.Attributes; | import java.util.jar.Attributes; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Utility methods for manifest stuff. | * Utility methods for manifest stuff. | ||||
| @@ -14,6 +14,8 @@ import java.util.ArrayList; | |||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.Hashtable; | import java.util.Hashtable; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Class to represent an individual section in the Manifest. A section | * Class to represent an individual section in the Manifest. A section | ||||
| @@ -22,7 +22,7 @@ import java.util.zip.ZipFile; | |||||
| import org.apache.aut.zip.ZipOutputStream; | import org.apache.aut.zip.ZipOutputStream; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.taskdefs.manifest.Manifest; | import org.apache.tools.ant.taskdefs.manifest.Manifest; | ||||
| import org.apache.tools.ant.taskdefs.manifest.ManifestException; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| import org.apache.tools.ant.taskdefs.manifest.ManifestUtil; | import org.apache.tools.ant.taskdefs.manifest.ManifestUtil; | ||||
| import org.apache.tools.ant.types.FileScanner; | import org.apache.tools.ant.types.FileScanner; | ||||
| @@ -1,121 +0,0 @@ | |||||
| /* | |||||
| * Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
| * | |||||
| * This software is published under the terms of the Apache Software License | |||||
| * version 1.1, a copy of which has been included with this distribution in | |||||
| * the LICENSE.txt file. | |||||
| */ | |||||
| package org.apache.tools.ant.taskdefs.manifest; | |||||
| import java.io.PrintWriter; | |||||
| import java.io.IOException; | |||||
| import java.util.jar.Attributes; | |||||
| /** | |||||
| * Class to hold manifest attributes | |||||
| * | |||||
| * @author <a href="mailto:conor@apache.org">Conor MacNeill</a> | |||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | |||||
| * @version $Revision$ $Date$ | |||||
| */ | |||||
| public class Attribute | |||||
| { | |||||
| /** | |||||
| * The attribute's name | |||||
| */ | |||||
| private String m_name; | |||||
| /** | |||||
| * The attribute's value | |||||
| */ | |||||
| private String m_value; | |||||
| /** | |||||
| * Construct an empty attribute | |||||
| */ | |||||
| public Attribute() | |||||
| { | |||||
| } | |||||
| /** | |||||
| * Construct a manifest by specifying its name and value | |||||
| * | |||||
| * @param name the attribute's name | |||||
| * @param value the Attribute's value | |||||
| */ | |||||
| public Attribute( final String name, final String value ) | |||||
| { | |||||
| m_name = name; | |||||
| m_value = value; | |||||
| } | |||||
| /** | |||||
| * Set the Attribute's name | |||||
| * | |||||
| * @param name the attribute's name | |||||
| */ | |||||
| public void setName( final String name ) | |||||
| { | |||||
| m_name = name; | |||||
| } | |||||
| /** | |||||
| * Set the Attribute's value | |||||
| * | |||||
| * @param value the attribute's value | |||||
| */ | |||||
| public void setValue( final String value ) | |||||
| { | |||||
| m_value = value; | |||||
| } | |||||
| /** | |||||
| * Get the Attribute's name | |||||
| * | |||||
| * @return the attribute's name. | |||||
| */ | |||||
| public String getName() | |||||
| { | |||||
| return m_name; | |||||
| } | |||||
| /** | |||||
| * Get the Attribute's value | |||||
| * | |||||
| * @return the attribute's value. | |||||
| */ | |||||
| public String getValue() | |||||
| { | |||||
| return m_value; | |||||
| } | |||||
| /** | |||||
| * Add a continuation line from the Manifest file When lines are too | |||||
| * long in a manifest, they are continued on the next line by starting | |||||
| * with a space. This method adds the continuation data to the attribute | |||||
| * value by skipping the first character. | |||||
| * | |||||
| * @param line The feature to be added to the Continuation attribute | |||||
| */ | |||||
| public void addContinuation( final String line ) | |||||
| { | |||||
| m_value += line.substring( 1 ); | |||||
| } | |||||
| public boolean equals( Object object ) | |||||
| { | |||||
| if( !( object instanceof Attribute ) ) | |||||
| { | |||||
| return false; | |||||
| } | |||||
| final Attribute other = (Attribute)object; | |||||
| final String name = other.m_name; | |||||
| return | |||||
| ( null != m_name && null != name && | |||||
| m_name.toLowerCase().equals( name.toLowerCase() ) && | |||||
| null != m_value && m_value.equals( other.m_value ) ); | |||||
| } | |||||
| } | |||||
| @@ -13,6 +13,8 @@ import java.util.Hashtable; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Set; | import java.util.Set; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Class to manage Manifest information | * Class to manage Manifest information | ||||
| @@ -1,50 +0,0 @@ | |||||
| /* | |||||
| * Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
| * | |||||
| * This software is published under the terms of the Apache Software License | |||||
| * version 1.1, a copy of which has been included with this distribution in | |||||
| * the LICENSE.txt file. | |||||
| */ | |||||
| package org.apache.tools.ant.taskdefs.manifest; | |||||
| import org.apache.avalon.framework.CascadingException; | |||||
| /** | |||||
| * ManifestException is thrown when there is a problem parsing, generating or | |||||
| * handling a Manifest. | |||||
| * | |||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | |||||
| * @version $Revision$ $Date$ | |||||
| */ | |||||
| public class ManifestException | |||||
| extends CascadingException | |||||
| { | |||||
| /** | |||||
| * Basic constructor for exception that does not specify a message | |||||
| */ | |||||
| public ManifestException() | |||||
| { | |||||
| this( "", null ); | |||||
| } | |||||
| /** | |||||
| * Basic constructor with a message | |||||
| * | |||||
| * @param message the message | |||||
| */ | |||||
| public ManifestException( final String message ) | |||||
| { | |||||
| this( message, null ); | |||||
| } | |||||
| /** | |||||
| * Constructor that builds cascade so that other exception information can be retained. | |||||
| * | |||||
| * @param message the message | |||||
| * @param throwable the throwable | |||||
| */ | |||||
| public ManifestException( final String message, final Throwable throwable ) | |||||
| { | |||||
| super( message, throwable ); | |||||
| } | |||||
| } | |||||
| @@ -17,6 +17,8 @@ import java.util.Iterator; | |||||
| import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Class to manage Manifest information | * Class to manage Manifest information | ||||
| @@ -16,6 +16,8 @@ import java.io.UnsupportedEncodingException; | |||||
| import java.io.BufferedReader; | import java.io.BufferedReader; | ||||
| import java.util.jar.Attributes; | import java.util.jar.Attributes; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Utility methods for manifest stuff. | * Utility methods for manifest stuff. | ||||
| @@ -14,6 +14,8 @@ import java.util.ArrayList; | |||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.Hashtable; | import java.util.Hashtable; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.aut.manifest.Attribute; | |||||
| import org.apache.aut.manifest.ManifestException; | |||||
| /** | /** | ||||
| * Class to represent an individual section in the Manifest. A section | * Class to represent an individual section in the Manifest. A section | ||||