ManifestClassPath (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs, class: ManifestClassPath

Package org.apache.tools.ant.taskdefs

# Class ManifestClassPath

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.ManifestClassPath

All Implemented Interfaces:
  `java.lang.Cloneable`

    public class ManifestClassPath
    extends Task

Converts a Path into a property suitable as a Manifest classpath.

Since:
  Ant 1.7

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.Task

  `target, taskName, taskType, wrapper`

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `ManifestClassPath()` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `void` | `addClassPath​(Path path)` | Adds the classpath to convert.
  `void` | `execute()` | Sets a property, which must not already exist, with a space separated list of files and directories relative to the jar file's parent directory.
  `void` | `setJarFile​(java.io.File jarfile)` | The JAR file to contain the classpath attribute in its manifest.
  `void` | `setMaxParentLevels​(int levels)` | Sets the maximum parent directory levels allowed when computing a relative path.
  `void` | `setProperty​(java.lang.String name)` | Sets the property name to hold the classpath value.

  ### Methods inherited from class org.apache.tools.ant.Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ManifestClassPath

    public ManifestClassPath()

- ## Method Details

  - ### execute

    public void execute()
    Sets a property, which must not already exist, with a space separated list of files and directories relative to the jar file's parent directory.
    Overrides:
      `execute` in class `Task`

  - ### setProperty

    public void setProperty​(java.lang.String name)
    Sets the property name to hold the classpath value.
    Parameters:
      `name` - the property name

  - ### setJarFile

    public void setJarFile​(java.io.File jarfile)
    The JAR file to contain the classpath attribute in its manifest.
    Parameters:
      `jarfile` - the JAR file. Need not exist yet, but its parent directory must exist on the other hand.

  - ### setMaxParentLevels

    public void setMaxParentLevels​(int levels)
    Sets the maximum parent directory levels allowed when computing a relative path.
    Parameters:
      `levels` - the max level. Defaults to 2.

  - ### addClassPath

    public void addClassPath​(Path path)
    Adds the classpath to convert.
    Parameters:
      `path` - the classpath to convert.