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 private java.util.Map<java.lang.String,java.lang.String>
attributes
private java.lang.String
bsn
private java.io.File[]
bundleClasspathExpansion
private DownloadBlocker
db
private java.lang.String
error
private java.io.File
file
private java.util.jar.Manifest
manifest
private long
manifestTime
private java.lang.String
path
private Project
project
private Container.TYPE
type
private java.lang.String
version
java.lang.String
warning
-
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)
private
Container(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 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()
private java.io.File[]
getBundleClasspathFiles()
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()
private boolean
isCurrent(java.io.File file, java.io.File member)
void
putAttribute(java.lang.String name, java.lang.String value)
private java.lang.String
toName(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.String
toString()
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.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
-
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.
-
-