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 class
Container.TYPE
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
warning
-
Constructor Summary
Constructors 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)
Container(Project project, java.lang.String bsn, java.io.File file, java.util.Map<java.lang.String,java.lang.String> attributes)
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 boolean
contributeFiles(java.util.List<java.io.File> files, Processor reporter)
Iterate over the containers and get the files they represent.boolean
equals(java.lang.Object other)
static Container
error(Project project, java.lang.String message)
static void
flatten(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 void
flatten(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()
BundleId
getBundleId()
java.lang.String
getBundleSymbolicName()
java.lang.String
getError()
java.io.File
getFile()
java.util.jar.Manifest
getManifest()
Answer the manifest for this container (if possible).java.util.List<Container>
getMembers()
Return the this if this is anything else but a library.Project
getProject()
Container.TYPE
getType()
java.lang.String
getVersion()
java.lang.String
getWarning()
int
hashCode()
boolean
isOk()
void
putAttribute(java.lang.String name, java.lang.String value)
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.String
toString()
Must show the file name or the error formatted as a file name
-
-
-
Constructor Detail
-
Container
public Container(Project project, java.lang.String bsn, java.io.File file, java.util.Map<java.lang.String,java.lang.String> attributes)
-
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)
-
-
Method Detail
-
getFile
public java.io.File getFile()
-
contributeFiles
public boolean contributeFiles(java.util.List<java.io.File> files, Processor reporter) throws java.lang.Exception
Iterate 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
toString
in 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)
-
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.Exception
Answer the manifest for this container (if possible). Manifest is cached until the file is renewed.- Throws:
java.lang.Exception
-
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()
-
-