Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class Jar

extends Zip
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.War, org.apache.tools.ant.taskdefs.Ear
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .File, .IOException, .InputStream, .InputStreamReader, .OutputStreamWriter, .PrintWriter, .Reader, .UnsupportedEncodingException, java.nio.charset.Charset, .StandardCharsets, java.nio.file.Files, java.util.ArrayList, .Collections, .Comparator, .HashSet, .List, .Set, .SortedMap, .StringTokenizer, .TreeMap, .Vector, java.util.zip.ZipEntry, .ZipFile, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.Manifest.Section, org.apache.tools.ant.types.ArchiveFileSet, .EnumeratedAttribute, .FileSet, .Mapper, .Path, .Resource, .ResourceCollection, .ZipFileSet, org.apache.tools.ant.types.spi.Service, org.apache.tools.ant.util.FileNameMapper, .FileUtils, .StreamUtils, org.apache.tools.zip.JarMarker, .ZipExtraField, .ZipOutputStream

Creates a JAR archive.
Since
Ant 1.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Jar.FilesetManifestConfig

The manifest config enumerated type.

private static class
Jar.IndexJarsFilenameMapper

A mapper for the index based on the classpath attribute in the manifest.

public static class
Jar.StrictMode

The strict enumerated type.

Field Summary

Modifier and TypeField and Description
private Manifest
configuredManifest

merged manifests added through addConfiguredManifest

private boolean
createEmpty

whether to really create the archive in createEmptyZip, will get set in getResourcesToAdd.

private Manifest
filesetManifest

merged manifests added through filesets

private Jar.FilesetManifestConfig
filesetManifestConfig

whether to merge fileset manifests; value is true if filesetmanifest is 'merge' or 'mergewithoutmain'

private boolean
flattenClassPaths

whether to flatten Class-Path attributes into a single one.

private boolean
index

jar index is JDK 1.3+ only

private static final String
INDEX_NAME

The index file name.

private Path
indexJars

Path containing jars that shall be indexed in addition to this archive.

private FileNameMapper
indexJarsMapper

A mapper used to convert the jars to entries in the index.

private boolean
indexMetaInf

Whether to index META-INF/ and its children

private static final ZipExtraField[]
JAR_MARKER

Extra fields needed to make Solaris recognize the archive as a jar file.

private Manifest
manifest

the manifest specified by the 'manifest' attribute

private static final String
MANIFEST_NAME

The manifest file name.

private String
manifestEncoding

The encoding to use when reading in a manifest file

private File
manifestFile

The file found from the 'manifest' attribute.

private boolean
mergeClassPaths

whether to merge Class-Path attributes.

private boolean
mergeManifestsMain

whether to merge the main section of fileset manifests; value is true if filesetmanifest is 'merge'

private Manifest
originalManifest

Manifest of original archive, will be set to null if not in update mode.

private List<String>
rootEntries

Stores all files that are in the root of the archive (i.e. that have a name that doesn't contain a slash) so they can get listed in the index.

private Manifest
savedConfiguredManifest

shadow of the above if upToDate check alters the value

private List<Service>
serviceList

List of all known SPI Services

private Jar.StrictMode
strict

Strict mode for checking rules of the JAR-Specification.

Inherited from org.apache.tools.ant.taskdefs.Zip:
addedDirsarchiveTypedoubleFilePassduplicateemptyBehaviorentriesskipWritingzipFile

Constructor Summary

AccessConstructor and Description
public
Jar()

constructor

Method Summary

Modifier and TypeMethod and Description
public void
addConfiguredIndexJars(Path
a path
p
)

Add a path to index jars.

public void
addConfiguredIndexJarsMapper(Mapper
a mapper
mapper
)

Add a mapper used to convert the jars to entries in the index.

public void
addConfiguredManifest(Manifest
an embedded manifest element
newManifest
)

Allows the manifest for the archive file to be provided inline in the build file rather than in an external file.

public void
addConfiguredService(Service
the nested element.
service
)

A nested SPI service element.

public void
addMetainf(ZipFileSet
zipfileset to add
fs
)

Adds a zipfileset to include in the META-INF directory.

private void
checkJarSpec()

Check against packaging spec

protected void
cleanUp()

Overrides org.apache.tools.ant.taskdefs.Zip.cleanUp.

Make sure we don't think we already have a MANIFEST next time this task gets executed.
private FileNameMapper

Returns:

a mapper
createDefaultIndexJarsMapper
()

Creates a mapper for the index based on the classpath attribute in the manifest.

protected boolean

Returns:

true for historic reasons
createEmptyZip
(File
the file to create
zipFile
)

Overrides org.apache.tools.ant.taskdefs.Zip.createEmptyZip.

Create an empty jar file.
private void
createIndexList(ZipOutputStream
the zip stream representing the jar being built.
zOut
)

Create the index list to speed up classloading.

private Manifest
private void
protected void
finalizeZipOutputStream(ZipOutputStream
the zip output stream
zOut
)

Overrides org.apache.tools.ant.taskdefs.Zip.finalizeZipOutputStream.

Finalize the zip output stream.
protected static String

Returns:

the matching entry, or null if the file is not found
findJarName
(String
the name to look for
fileName
,
String[]
the classpath to look in (may be null)
classpath
)

try to guess the name of the given file.

public FileNameMapper
getIndexJarsMapper()

Returns the mapper used to convert the jars to entries in the index.

private Manifest
getManifest(File manifestFile)

private Manifest
private Charset
private Manifest

Returns:

null if jarFile doesn't contain a manifest, the manifest otherwise.
getManifestFromJar
(File jarFile)

protected Zip.ArchiveState

Returns:

an array of resources to add for each fileset passed in as well as a flag that indicates whether the archive is uptodate.
getResourcesToAdd
(ResourceCollection[]
The resource collections to grab resources from
rcs
,
File
intended archive file (may or may not exist)
zipFile
,
boolean
whether we already know that the archive is out-of-date. Subclasses overriding this method are supposed to set this value correctly in their call to super.getResourcesToAdd.
needsUpdate
)

Overrides org.apache.tools.ant.taskdefs.Zip.getResourcesToAdd.

Collect the resources that are newer than the corresponding entries (or missing) in the original archive.
protected static void
grabFilesAndDirs(String
the zip file to examine
file
,
List<String>
where to place the directories found
dirs
,
List<String>
where to place the files found
files
)

Grab lists of all root-level files and all directories contained in the given archive.

private Resource[][]
protected void
initZipOutputStream(ZipOutputStream
the zip output stream
zOut
)

Overrides org.apache.tools.ant.taskdefs.Zip.initZipOutputStream.

Initialize the zip output stream.
private boolean
jarHasIndex(File jarFile)

public void
reset()

Overrides org.apache.tools.ant.taskdefs.Zip.reset.

reset to default values.
public void
setFilesetmanifest(Jar.FilesetManifestConfig
setting for found manifest behavior.
config
)

Behavior when a Manifest is found in a zipfileset or zipgroupfileset file.

public void
setFlattenAttributes(boolean
boolean
b
)

Whether to flatten multi-valued attributes (i.e. Class-Path) into a single one.

public void
setIndex(boolean
a boolean value
flag
)

Set whether or not to create an index list for classes.

public void
setIndexMetaInf(boolean
a boolean value, defaults to false
flag
)

Set whether or not to add META-INF and its children to the index.

public void
setJarfile(File
the destination file
jarFile
)

Deprecated since 1.5.x. Use setDestFile(File) instead.
Set the destination file.
public void
setManifest(File
the manifest file to use.
manifestFile
)

The manifest file to use.

public void
setManifestEncoding(String
the character encoding
manifestEncoding
)

The character encoding to use in the manifest file.

public void
setMergeClassPathAttributes(boolean
boolean
b
)

Whether to merge Class-Path attributes.

public void
setStrict(Jar.StrictMode
New value of the strict mode.
strict
)

Activate the strict mode.

public void
setWhenempty(Zip.WhenEmpty
not used
we
)

Overrides org.apache.tools.ant.taskdefs.Zip.setWhenempty.

Not used for jar files.
public void
setWhenmanifestonly(Zip.WhenEmpty
a WhenEmpty enumerated value
we
)

Indicates if a jar file should be created when it would only contain a manifest file.

protected final void
writeIndexLikeList(List<String>
a list of directories
dirs
,
List<String>
a list of files
files
,
PrintWriter
the writer to write to
writer
)

Writes the directory entries from the first and the filenames from the second list to the given writer, one entry per line.

private void
private void
writeServices(ZipOutputStream zOut)

Write SPI Information to JAR

protected void
zipFile(InputStream
the stream to read data for the entry from. The caller of the method is responsible for closing the stream.
is
,
ZipOutputStream
the zip output stream
zOut
,
String
the name this entry shall have in the archive
vPath
,
long
last modification time for the entry.
lastModified
,
File
the original archive we are copying this entry from, will be null if we are not copying from an archive.
fromArchive
,
int
the Unix permissions to set.
mode
)

Overrides org.apache.tools.ant.taskdefs.Zip.zipFile.

Overridden from Zip class to deal with manifests and index lists.
Inherited from org.apache.tools.ant.taskdefs.Zip:
addaddFilesetaddParentDirsaddResourcesaddResourcesaddZipfilesetaddZipGroupFilesetexecuteexecuteMaingetCommentgetCreateUnicodeExtraFieldsgetCurrentExtraFieldsgetDestFilegetEncodinggetFallBackToUTF8getLevelgetModificationtimegetNonFileSetResourcesToAddgetPreserve0PermissionsgetResourcesToAddgetUseLanguageEnodingFlaggetZip64ModegrabNonFileSetResourcesgrabResourceshasUpdatedFileisAddingNewFilesisCompressisEmptyisFirstPassisInUpdateModelogWhenWritingselectDirectoryResourcesselectFileResourcesselectResourcessetBasedirsetCommentsetCompresssetCreateUnicodeExtraFieldssetCurrentExtraFieldssetDestFilesetDuplicatesetEncodingsetFallBackToUTF8setFilesetFilesonlysetKeepCompressionsetLevelsetModificationtimesetPreserve0PermissionssetRoundUpsetUpdatesetUseLanguageEncodingFlagsetZip64ModesetZipfilezipDirzipDirzipDirzipFilezipFile

Field Detail

configuredManifestback to summary
private Manifest configuredManifest

merged manifests added through addConfiguredManifest

createEmptyback to summary
private boolean createEmpty

whether to really create the archive in createEmptyZip, will get set in getResourcesToAdd.

filesetManifestback to summary
private Manifest filesetManifest

merged manifests added through filesets

filesetManifestConfigback to summary
private Jar.FilesetManifestConfig filesetManifestConfig

whether to merge fileset manifests; value is true if filesetmanifest is 'merge' or 'mergewithoutmain'

flattenClassPathsback to summary
private boolean flattenClassPaths

whether to flatten Class-Path attributes into a single one.

indexback to summary
private boolean index

jar index is JDK 1.3+ only

INDEX_NAMEback to summary
private static final String INDEX_NAME

The index file name.

indexJarsback to summary
private Path indexJars

Path containing jars that shall be indexed in addition to this archive.

Since
Ant 1.6.2
indexJarsMapperback to summary
private FileNameMapper indexJarsMapper

A mapper used to convert the jars to entries in the index.

Since
Ant 1.10.9
indexMetaInfback to summary
private boolean indexMetaInf

Whether to index META-INF/ and its children

JAR_MARKERback to summary
private static final ZipExtraField[] JAR_MARKER

Extra fields needed to make Solaris recognize the archive as a jar file.

Since
Ant 1.6.3
manifestback to summary
private Manifest manifest

the manifest specified by the 'manifest' attribute

MANIFEST_NAMEback to summary
private static final String MANIFEST_NAME

The manifest file name.

manifestEncodingback to summary
private String manifestEncoding

The encoding to use when reading in a manifest file

manifestFileback to summary
private File manifestFile

The file found from the 'manifest' attribute. This can be either the location of a manifest, or the name of a jar added through a fileset. If its the name of an added jar, the manifest is looked for in META-INF/MANIFEST.MF

mergeClassPathsback to summary
private boolean mergeClassPaths

whether to merge Class-Path attributes.

mergeManifestsMainback to summary
private boolean mergeManifestsMain

whether to merge the main section of fileset manifests; value is true if filesetmanifest is 'merge'

originalManifestback to summary
private Manifest originalManifest

Manifest of original archive, will be set to null if not in update mode.

rootEntriesback to summary
private List<String> rootEntries

Stores all files that are in the root of the archive (i.e. that have a name that doesn't contain a slash) so they can get listed in the index. Will not be filled unless the user has asked for an index.

Since
Ant 1.6
savedConfiguredManifestback to summary
private Manifest savedConfiguredManifest

shadow of the above if upToDate check alters the value

serviceListback to summary
private List<Service> serviceList

List of all known SPI Services

strictback to summary
private Jar.StrictMode strict

Strict mode for checking rules of the JAR-Specification.

See Also

Constructor Detail

Jarback to summary
public Jar()

constructor

Method Detail

addConfiguredIndexJarsback to summary
public void addConfiguredIndexJars(Path p)

Add a path to index jars.

Parameters
p:Path

a path

Since
Ant 1.6.2
addConfiguredIndexJarsMapperback to summary
public void addConfiguredIndexJarsMapper(Mapper mapper)

Add a mapper used to convert the jars to entries in the index.

Parameters
mapper:Mapper

a mapper

Since
Ant 1.10.9
addConfiguredManifestback to summary
public void addConfiguredManifest(Manifest newManifest) throws ManifestException

Allows the manifest for the archive file to be provided inline in the build file rather than in an external file.

Parameters
newManifest:Manifest

an embedded manifest element

Exceptions
ManifestException:
on error
addConfiguredServiceback to summary
public void addConfiguredService(Service service)

A nested SPI service element.

Parameters
service:Service

the nested element.

Since
Ant 1.7
addMetainfback to summary
public void addMetainf(ZipFileSet fs)

Adds a zipfileset to include in the META-INF directory.

Parameters
fs:ZipFileSet

zipfileset to add

checkJarSpecback to summary
private void checkJarSpec()

Check against packaging spec

See Also
https://docs.oracle.com/javase/tutorial/deployment/jar/packageman.html
cleanUpback to summary
protected void cleanUp()

Overrides org.apache.tools.ant.taskdefs.Zip.cleanUp.

Make sure we don't think we already have a MANIFEST next time this task gets executed.

Annotations
@Override
See Also
Zip#cleanUp
createDefaultIndexJarsMapperback to summary
private FileNameMapper createDefaultIndexJarsMapper()

Creates a mapper for the index based on the classpath attribute in the manifest. See findJarName(String, String[]) for more details.

Returns:FileNameMapper

a mapper

Since
Ant 1.10.9
createEmptyZipback to summary
protected boolean createEmptyZip(File zipFile) throws BuildException

Overrides org.apache.tools.ant.taskdefs.Zip.createEmptyZip.

Create an empty jar file.

Parameters
zipFile:File

the file to create

Returns:boolean

true for historic reasons

Annotations
@Override
Exceptions
BuildException:
on error
createIndexListback to summary
private void createIndexList(ZipOutputStream zOut) throws IOException

Create the index list to speed up classloading. This is a JDK 1.3+ specific feature and is enabled by default. See the JAR index specification for more details.

Parameters
zOut:ZipOutputStream

the zip stream representing the jar being built.

Exceptions
IOException:
thrown if there is an error while creating the index and adding it to the zip stream.
createManifestback to summary
private Manifest createManifest() throws BuildException
filesetManifestback to summary
private void filesetManifest(File file, InputStream is) throws IOException
finalizeZipOutputStreamback to summary
protected void finalizeZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException

Overrides org.apache.tools.ant.taskdefs.Zip.finalizeZipOutputStream.

Finalize the zip output stream. This creates an index list if the index attribute is true.

Parameters
zOut:ZipOutputStream

the zip output stream

Annotations
@Override
Exceptions
IOException:
on I/O errors
BuildException:
on other errors
findJarNameback to summary
protected static String findJarName(String fileName, String[] classpath)

try to guess the name of the given file.

If this jar has a classpath attribute in its manifest, we can assume that it will only require an index of jars listed there. try to find which classpath entry is most likely the one the given file name points to.

In the absence of a classpath attribute, assume the other files will be placed inside the same directory as this jar and use their basename.

if there is a classpath and the given file doesn't match any of its entries, return null.

Parameters
fileName:String

the name to look for

classpath:String[]

the classpath to look in (may be null)

Returns:String

the matching entry, or null if the file is not found

Since
Ant 1.6.2
getIndexJarsMapperback to summary
public FileNameMapper getIndexJarsMapper()

Returns the mapper used to convert the jars to entries in the index. May be null.

Since
Ant 1.10.9
getManifestback to summary
private Manifest getManifest(File manifestFile)
getManifestback to summary
private Manifest getManifest(Reader r)
getManifestCharsetback to summary
private Charset getManifestCharset()
getManifestFromJarback to summary
private Manifest getManifestFromJar(File jarFile) throws IOException
Returns:Manifest

null if jarFile doesn't contain a manifest, the manifest otherwise.

Since
Ant 1.5.2
getResourcesToAddback to summary
protected Zip.ArchiveState getResourcesToAdd(ResourceCollection[] rcs, File zipFile, boolean needsUpdate) throws BuildException

Overrides org.apache.tools.ant.taskdefs.Zip.getResourcesToAdd.

Collect the resources that are newer than the corresponding entries (or missing) in the original archive.

If we are going to recreate the archive instead of updating it, all resources should be considered as new, if a single one is. Because of this, subclasses overriding this method must call super.getResourcesToAdd and indicate with the third arg if they already know that the archive is out-of-date.

Parameters
rcs:ResourceCollection[]

The resource collections to grab resources from

zipFile:File

intended archive file (may or may not exist)

needsUpdate:boolean

whether we already know that the archive is out-of-date. Subclasses overriding this method are supposed to set this value correctly in their call to super.getResourcesToAdd.

Returns:Zip.ArchiveState

an array of resources to add for each fileset passed in as well as a flag that indicates whether the archive is uptodate.

Annotations
@Override
Exceptions
BuildException:
if it likes
grabFilesAndDirsback to summary
protected static void grabFilesAndDirs(String file, List<String> dirs, List<String> files) throws IOException

Grab lists of all root-level files and all directories contained in the given archive.

Parameters
file:String

the zip file to examine

dirs:List<String>

where to place the directories found

files:List<String>

where to place the files found

Exceptions
IOException:
on error
Since
Ant 1.7
grabManifestsback to summary
private Resource[][] grabManifests(ResourceCollection[] rcs)
initZipOutputStreamback to summary
protected void initZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException

Overrides org.apache.tools.ant.taskdefs.Zip.initZipOutputStream.

Initialize the zip output stream.

Parameters
zOut:ZipOutputStream

the zip output stream

Annotations
@Override
Exceptions
IOException:
on I/O errors
BuildException:
on other errors
jarHasIndexback to summary
private boolean jarHasIndex(File jarFile) throws IOException
resetback to summary
public void reset()

Overrides org.apache.tools.ant.taskdefs.Zip.reset.

reset to default values.

Annotations
@Override
Since
1.44, Ant 1.5
See Also
Zip#reset
setFilesetmanifestback to summary
public void setFilesetmanifest(Jar.FilesetManifestConfig config)

Behavior when a Manifest is found in a zipfileset or zipgroupfileset file. Valid values are "skip", "merge", and "mergewithoutmain". "merge" will merge all of manifests together, and merge this into any other specified manifests. "mergewithoutmain" merges everything but the Main section of the manifests. Default value is "skip".

Note

if this attribute's value is not "skip", the created jar will not be readable by using java.util.jar.JarInputStream

Parameters
config:Jar.FilesetManifestConfig

setting for found manifest behavior.

setFlattenAttributesback to summary
public void setFlattenAttributes(boolean b)

Whether to flatten multi-valued attributes (i.e. Class-Path) into a single one.

Parameters
b:boolean

boolean

Since
Ant 1.8.0
setIndexback to summary
public void setIndex(boolean flag)

Set whether or not to create an index list for classes. This may speed up classloading in some cases.

Parameters
flag:boolean

a boolean value

setIndexMetaInfback to summary
public void setIndexMetaInf(boolean flag)

Set whether or not to add META-INF and its children to the index.

Doesn't have any effect if index is false.

Sun's jar implementation used to skip the META-INF directory and Ant followed that example. The behavior has been changed with Java 5. In order to avoid problems with Ant generated jars on Java 1.4 or earlier Ant will not include META-INF unless explicitly asked to.

Parameters
flag:boolean

a boolean value, defaults to false

Since
Ant 1.8.0
See Also
jar -i omits service providers in index.list
setJarfileback to summary
public void setJarfile(File jarFile)

Deprecated

since 1.5.x. Use setDestFile(File) instead.

Set the destination file.

Parameters
jarFile:File

the destination file

Annotations
@Deprecated
setManifestback to summary
public void setManifest(File manifestFile)

The manifest file to use. This can be either the location of a manifest, or the name of a jar added through a fileset. If its the name of an added jar, the task expects the manifest to be in the jar at META-INF/MANIFEST.MF.

Parameters
manifestFile:File

the manifest file to use.

setManifestEncodingback to summary
public void setManifestEncoding(String manifestEncoding)

The character encoding to use in the manifest file.

Parameters
manifestEncoding:String

the character encoding

setMergeClassPathAttributesback to summary
public void setMergeClassPathAttributes(boolean b)

Whether to merge Class-Path attributes.

Parameters
b:boolean

boolean

Since
Ant 1.8.0
setStrictback to summary
public void setStrict(Jar.StrictMode strict)

Activate the strict mode. When set to true a BuildException will be thrown if the Jar-Packaging specification was broken.

Parameters
strict:Jar.StrictMode

New value of the strict mode.

Since
Ant 1.7.1
setWhenemptyback to summary
public void setWhenempty(Zip.WhenEmpty we)

Overrides org.apache.tools.ant.taskdefs.Zip.setWhenempty.

Not used for jar files.

Parameters
we:Zip.WhenEmpty

not used

Annotations
@Override
setWhenmanifestonlyback to summary
public void setWhenmanifestonly(Zip.WhenEmpty we)

Indicates if a jar file should be created when it would only contain a manifest file. Possible values are: fail (throw an exception and halt the build); skip (do not create any archive, but issue a warning); create (make an archive with only a manifest file). Default is create;

Parameters
we:Zip.WhenEmpty

a WhenEmpty enumerated value

writeIndexLikeListback to summary
protected final void writeIndexLikeList(List<String> dirs, List<String> files, PrintWriter writer)

Writes the directory entries from the first and the filenames from the second list to the given writer, one entry per line.

Parameters
dirs:List<String>

a list of directories

files:List<String>

a list of files

writer:PrintWriter

the writer to write to

Since
Ant 1.6.2
writeManifestback to summary
private void writeManifest(ZipOutputStream zOut, Manifest manifest) throws IOException
writeServicesback to summary
private void writeServices(ZipOutputStream zOut) throws IOException

Write SPI Information to JAR

zipFileback to summary
protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) throws IOException

Overrides org.apache.tools.ant.taskdefs.Zip.zipFile.

Overridden from Zip class to deal with manifests and index lists.

Parameters
is:InputStream

the stream to read data for the entry from. The caller of the method is responsible for closing the stream.

zOut:ZipOutputStream

the zip output stream

vPath:String

the name this entry shall have in the archive

lastModified:long

last modification time for the entry.

fromArchive:File

the original archive we are copying this entry from, will be null if we are not copying from an archive.

mode:int

the Unix permissions to set.

Annotations
@Override
Exceptions
IOException:
on error
org.apache.tools.ant.taskdefs back to summary

public Class Jar.FilesetManifestConfig

extends EnumeratedAttribute
Class Inheritance

The manifest config enumerated type.

Field Summary

Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
value

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

the list of values - "skip", "merge" and "mergewithoutmain"
getValues
()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Get the list of valid strings.
Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
containsValuegetIndexgetInstancegetValueindexOfValuesetValuetoString

Constructor Detail

FilesetManifestConfigback to summary
public FilesetManifestConfig()

Method Detail

getValuesback to summary
public String[] getValues()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Get the list of valid strings.

Returns:String[]

the list of values - "skip", "merge" and "mergewithoutmain"

Annotations
@Override
org.apache.tools.ant.taskdefs back to summary

private Class Jar.IndexJarsFilenameMapper

extends Object
implements FileNameMapper
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.util.FileNameMapper

A mapper for the index based on the classpath attribute in the manifest. See findJarName(String, String[]) for more details.
Since
Ant 1.10.9

Field Summary

Modifier and TypeField and Description
private String[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String[]
mapFileName(String
the name of the source file relative to some given basedirectory. Might be null for resources that don't provide a name.
sourceFileName
)

Implements org.apache.tools.ant.util.FileNameMapper.mapFileName.

Returns an array containing the target filename(s) for the given source file.
public void
setFrom(String
a string.
from
)

Implements org.apache.tools.ant.util.FileNameMapper.setFrom.

Empty implementation.
public void
setTo(String
a string.
to
)

Implements org.apache.tools.ant.util.FileNameMapper.setTo.

Empty implementation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classpathback to summary
private String[] classpath

Constructor Detail

IndexJarsFilenameMapperback to summary
pack-priv IndexJarsFilenameMapper(String[] classpath)

Method Detail

mapFileNameback to summary
public String[] mapFileName(String sourceFileName)

Implements org.apache.tools.ant.util.FileNameMapper.mapFileName.

Doc from org.apache.tools.ant.util.FileNameMapper.mapFileName.

Returns an array containing the target filename(s) for the given source file.

if the given rule doesn't apply to the source file, implementation must return null. SourceFileScanner will then omit the source file in question.

Parameters
sourceFileName:String

the name of the source file relative to some given basedirectory. Might be null for resources that don't provide a name.

Returns:String[]

an array of strings if the rule applies to the source file, or null if it does not.

Annotations
@Override
setFromback to summary
public void setFrom(String from)

Implements org.apache.tools.ant.util.FileNameMapper.setFrom.

Empty implementation.

Parameters
from:String

Doc from org.apache.tools.ant.util.FileNameMapper.setFrom.

a string.

Annotations
@Override
setToback to summary
public void setTo(String to)

Implements org.apache.tools.ant.util.FileNameMapper.setTo.

Empty implementation.

Parameters
to:String

Doc from org.apache.tools.ant.util.FileNameMapper.setTo.

a string.

Annotations
@Override
org.apache.tools.ant.taskdefs back to summary

public Class Jar.StrictMode

extends EnumeratedAttribute
Class Inheritance

The strict enumerated type.

Field Summary

Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
value

Constructor Summary

AccessConstructor and Description
public
StrictMode()

Public no arg constructor.

public
StrictMode(String
the enumerated value as a string.
value
)

Constructor with an arg.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The log level according to the strict mode.
getLogLevel
()

public String[]

Returns:

the list of values.
getValues
()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Get List of valid strings.
Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
containsValuegetIndexgetInstancegetValueindexOfValuesetValuetoString

Constructor Detail

StrictModeback to summary
public StrictMode()

Public no arg constructor.

StrictModeback to summary
public StrictMode(String value)

Constructor with an arg.

Parameters
value:String

the enumerated value as a string.

Method Detail

getLogLevelback to summary
public int getLogLevel()
Returns:int

The log level according to the strict mode.

getValuesback to summary
public String[] getValues()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Get List of valid strings.

Returns:String[]

the list of values.

Annotations
@Override