Package aQute.bnd.build
Class Container
- java.lang.Object
-
- aQute.bnd.build.Container
-
public class Container extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContainer.TYPE
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>attributesprivate java.lang.Stringbsnprivate java.io.File[]bundleClasspathExpansionprivate DownloadBlockerdbprivate java.lang.Stringerrorprivate java.io.Filefileprivate java.util.jar.Manifestmanifestprivate longmanifestTimeprivate java.lang.Stringpathprivate Projectprojectprivate Container.TYPEtypeprivate java.lang.Stringversionjava.lang.Stringwarning
-
Constructor Summary
Constructors Modifier Constructor Description Container(Project project, java.io.File file)Container(Project project, java.io.File file, java.util.Map<java.lang.String,java.lang.String> attributes)privateContainer(Project project, java.lang.String message)(package private)Container(Project project, java.lang.String bsn, java.lang.String version, Container.TYPE type, java.io.File source, java.lang.String error, java.util.Map<java.lang.String,java.lang.String> attributes, DownloadBlocker db)Container(java.io.File file, DownloadBlocker db)Container(java.io.File file, DownloadBlocker db, Attrs attributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontributeFiles(java.util.List<java.io.File> files, Processor reporter)Iterate over the containers and get the files they represent.booleanequals(java.lang.Object other)static Containererror(Project project, java.lang.String message)static voidflatten(Container container, java.util.List<Container> list)Flatten a container in the output list.static java.util.List<Container>flatten(java.util.Collection<Container> containers)Take a container list and flatten it (e.g.static voidflatten(java.util.Collection<Container> containers, java.util.List<Container> list)Take a container list and flatten it (e.g.java.util.Map<java.lang.String,java.lang.String>getAttributes()private java.io.File[]getBundleClasspathFiles()BundleIdgetBundleId()java.lang.StringgetBundleSymbolicName()java.lang.StringgetError()java.io.FilegetFile()java.util.jar.ManifestgetManifest()Answer the manifest for this container (if possible).java.util.List<Container>getMembers()Return the this if this is anything else but a library.ProjectgetProject()Container.TYPEgetType()java.lang.StringgetVersion()java.lang.StringgetWarning()private java.util.Map<java.lang.String,java.lang.String>getWritableAttributes()inthashCode()private booleanisCurrent(java.io.File file, java.io.File member)booleanisOk()voidputAttribute(java.lang.String name, java.lang.String value)private java.lang.StringtoName(java.lang.String key)static java.util.List<java.lang.String>toPaths(java.util.List<java.lang.String> errors, java.util.Collection<Container> containers)Convert a set of containers to a list of paths.java.lang.StringtoString()Must show the file name or the error formatted as a file name
-
-
-
Field Detail
-
file
private volatile java.io.File file
-
path
private final java.lang.String path
-
type
private final Container.TYPE type
-
bsn
private final java.lang.String bsn
-
version
private final java.lang.String version
-
error
private volatile java.lang.String error
-
project
private final Project project
-
db
private volatile DownloadBlocker db
-
attributes
private volatile java.util.Map<java.lang.String,java.lang.String> attributes
-
manifestTime
private long manifestTime
-
manifest
private java.util.jar.Manifest manifest
-
bundleClasspathExpansion
private volatile java.io.File[] bundleClasspathExpansion
-
warning
public java.lang.String warning
-
-
Constructor Detail
-
Container
Container(Project project, java.lang.String bsn, java.lang.String version, Container.TYPE type, java.io.File source, java.lang.String error, java.util.Map<java.lang.String,java.lang.String> attributes, DownloadBlocker db)
-
Container
public Container(Project project, java.io.File file, java.util.Map<java.lang.String,java.lang.String> attributes)
-
Container
public Container(Project project, java.io.File file)
-
Container
public Container(java.io.File file, DownloadBlocker db)
-
Container
public Container(java.io.File file, DownloadBlocker db, Attrs attributes)
-
Container
private Container(Project project, java.lang.String message)
-
-
Method Detail
-
getFile
public java.io.File getFile()
-
contributeFiles
public boolean contributeFiles(java.util.List<java.io.File> files, Processor reporter) throws java.lang.ExceptionIterate over the containers and get the files they represent. If a file is already in the list, it is not added again.- Parameters:
files-- Throws:
java.lang.Exception
-
getBundleSymbolicName
public java.lang.String getBundleSymbolicName()
-
getVersion
public java.lang.String getVersion()
-
getType
public Container.TYPE getType()
-
getError
public java.lang.String getError()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getProject
public Project getProject()
-
toString
public java.lang.String toString()
Must show the file name or the error formatted as a file name- Overrides:
toStringin classjava.lang.Object
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
-
putAttribute
public void putAttribute(java.lang.String name, java.lang.String value)
-
getWritableAttributes
private java.util.Map<java.lang.String,java.lang.String> getWritableAttributes()
-
getMembers
public java.util.List<Container> getMembers() throws java.lang.Exception
Return the this if this is anything else but a library. If it is a library, return the members. This could work recursively, e.g., libraries can point to libraries.- Throws:
java.lang.Exception
-
flatten
public static void flatten(Container container, java.util.List<Container> list) throws java.lang.Exception
Flatten a container in the output list. (e.g. expand any libraries).- Parameters:
container- the container to flattenlist- the result list- Throws:
java.lang.Exception
-
flatten
public static java.util.List<Container> flatten(java.util.Collection<Container> containers) throws java.lang.Exception
Take a container list and flatten it (e.g. expand any libraries).- Parameters:
containers- The containers to flatten, can be null- Returns:
- a list of containers guaranteed to contain no libraries
- Throws:
java.lang.Exception
-
flatten
public static void flatten(java.util.Collection<Container> containers, java.util.List<Container> list) throws java.lang.Exception
Take a container list and flatten it (e.g. expand any libraries).- Parameters:
containers- The containers to flatten, can be nulllist- of containers guaranteed to contain no libraries- Throws:
java.lang.Exception
-
getManifest
public java.util.jar.Manifest getManifest() throws java.lang.ExceptionAnswer the manifest for this container (if possible). Manifest is cached until the file is renewed.- Throws:
java.lang.Exception
-
getBundleClasspathFiles
private java.io.File[] getBundleClasspathFiles() throws java.lang.Exception- Throws:
java.lang.Exception
-
isCurrent
private boolean isCurrent(java.io.File file, java.io.File member)
-
toName
private java.lang.String toName(java.lang.String key)
-
getWarning
public java.lang.String getWarning()
-
toPaths
public static java.util.List<java.lang.String> toPaths(java.util.List<java.lang.String> errors, java.util.Collection<Container> containers)Convert a set of containers to a list of paths. Only containers that have no error will be converted. Any errors will be collected in the errors parameter. If the errors parameter is null, an exception is thrown for the first erroneous container.- Parameters:
errors- a list of errors or nullcontainers- the containers to convert.
-
isOk
public boolean isOk()
-
getBundleId
public BundleId getBundleId()
-
-