Top Description Constructors Methods
org.apache.tools.ant.taskdefs.optional.extension

public final Class ExtensionUtil

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.util.ArrayList, .Collections, .List, java.util.jar.JarFile, .Manifest, java.util.stream.Collectors, org.apache.tools.ant.BuildException, .DirectoryScanner, .Project, org.apache.tools.ant.types.FileSet

A set of useful methods relating to extensions.

Constructor Summary

AccessConstructor and Description
private
ExtensionUtil()

Class is not meant to be instantiated.

Method Summary

Modifier and TypeMethod and Description
private static void
addExtension(final List<Extension>
the list of extensions to add to
extensionList
,
final Extension
the extension
originalExtension
,
final boolean
false to exclude implementation details
includeImpl
,
final boolean
false to exclude implementation URL
includeURL
)

Add extension to list.

pack-priv static void
extractExtensions(final Project project, final List<Extension>
the list to add extensions to
libraries
,
final List<FileSet>
the filesets containing libraries
fileset
)

Generate a list of extensions from a specified fileset.

private static Extension[]

Returns:

the extensions contained in libraries
getExtensions
(final Project project, final List<FileSet>
the filesets for libraries
libraries
)

Retrieve extensions from the specified libraries.

pack-priv static Manifest

Returns:

the manifest
getManifest
(final File
the file
file
)

Retrieve manifest for specified file.

private static void
loadExtensions(final File
the file
file
,
final List<Extension>
the list to add available extensions to
extensionList
,
final boolean includeImpl, final boolean includeURL)

Load list of available extensions from specified file.

pack-priv static ArrayList<Extension>
toExtensions(final List<? extends ExtensionAdapter>
the list of ExtensionAdapters to add to convert
adapters
)

Convert a list of extensionAdapter objects to extensions.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExtensionUtilback to summary
private ExtensionUtil()

Class is not meant to be instantiated.

Method Detail

addExtensionback to summary
private static void addExtension(final List<Extension> extensionList, final Extension originalExtension, final boolean includeImpl, final boolean includeURL)

Add extension to list. If extension should not have implementation details but does strip them. If extension should not have url but does then strip it.

Parameters
extensionList:List<Extension>

the list of extensions to add to

originalExtension:Extension

the extension

includeImpl:boolean

false to exclude implementation details

includeURL:boolean

false to exclude implementation URL

extractExtensionsback to summary
pack-priv static void extractExtensions(final Project project, final List<Extension> libraries, final List<FileSet> fileset) throws BuildException

Generate a list of extensions from a specified fileset.

Parameters
libraries:List<Extension>

the list to add extensions to

fileset:List<FileSet>

the filesets containing libraries

Exceptions
BuildException:
if an error occurs
getExtensionsback to summary
private static Extension[] getExtensions(final Project project, final List<FileSet> libraries) throws BuildException

Retrieve extensions from the specified libraries.

Parameters
libraries:List<FileSet>

the filesets for libraries

Returns:Extension[]

the extensions contained in libraries

Exceptions
BuildException:
if failing to scan libraries
getManifestback to summary
pack-priv static Manifest getManifest(final File file) throws BuildException

Retrieve manifest for specified file.

Parameters
file:File

the file

Returns:Manifest

the manifest

Exceptions
BuildException:
if error occurs (file doesn't exist, file not a jar, manifest doesn't exist in file)
loadExtensionsback to summary
private static void loadExtensions(final File file, final List<Extension> extensionList, final boolean includeImpl, final boolean includeURL) throws BuildException

Load list of available extensions from specified file.

Parameters
file:File

the file

extensionList:List<Extension>

the list to add available extensions to

Exceptions
BuildException:
if there is an error
toExtensionsback to summary
pack-priv static ArrayList<Extension> toExtensions(final List<? extends ExtensionAdapter> adapters) throws BuildException

Convert a list of extensionAdapter objects to extensions.

Parameters
adapters:List<? extends ExtensionAdapter>

the list of ExtensionAdapters to add to convert

Exceptions
BuildException:
if an error occurs