Class Container

java.lang.Object
aQute.bnd.build.Container

public class Container extends Object
  • Field Details

    • file

      private volatile File file
    • path

      private final String path
    • type

      private final Container.TYPE type
    • bsn

      private final String bsn
    • version

      private final String version
    • error

      private volatile String error
    • project

      private final Project project
    • db

      private volatile DownloadBlocker db
    • attributes

      private volatile Map<String,String> attributes
    • manifestTime

      private long manifestTime
    • manifest

      private Manifest manifest
    • bundleClasspathExpansion

      private volatile File[] bundleClasspathExpansion
    • warning

      public String warning
  • Constructor Details

  • Method Details

    • getFile

      public File getFile()
    • contributeFiles

      public boolean contributeFiles(List<File> files, Processor reporter) throws 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:
      Exception
    • getBundleSymbolicName

      public String getBundleSymbolicName()
    • getVersion

      public String getVersion()
    • getType

      public Container.TYPE getType()
    • getError

      public String getError()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getProject

      public Project getProject()
    • toString

      public String toString()
      Must show the file name or the error formatted as a file name
      Overrides:
      toString in class Object
    • getAttributes

      public Map<String,String> getAttributes()
    • putAttribute

      public void putAttribute(String name, String value)
    • getWritableAttributes

      private Map<String,String> getWritableAttributes()
    • getMembers

      public List<Container> getMembers() throws 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:
      Exception
    • flatten

      public static void flatten(Container container, List<Container> list) throws Exception
      Flatten a container in the output list. (e.g. expand any libraries).
      Parameters:
      container - the container to flatten
      list - the result list
      Throws:
      Exception
    • flatten

      public static List<Container> flatten(Collection<Container> containers) throws 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:
      Exception
    • flatten

      public static void flatten(Collection<Container> containers, List<Container> list) throws Exception
      Take a container list and flatten it (e.g. expand any libraries).
      Parameters:
      containers - The containers to flatten, can be null
      list - of containers guaranteed to contain no libraries
      Throws:
      Exception
    • getManifest

      public Manifest getManifest() throws Exception
      Answer the manifest for this container (if possible). Manifest is cached until the file is renewed.
      Throws:
      Exception
    • getBundleClasspathFiles

      private File[] getBundleClasspathFiles() throws Exception
      Throws:
      Exception
    • isCurrent

      private boolean isCurrent(File file, File member)
    • toName

      private String toName(String key)
    • getWarning

      public String getWarning()
    • toPaths

      public static List<String> toPaths(List<String> errors, 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 null
      containers - the containers to convert.
    • error

      public static Container error(Project project, String message)
    • isOk

      public boolean isOk()
    • getBundleId

      public BundleId getBundleId()