Class JavaPackage


  • public class JavaPackage
    extends Package
    Class describing a Java package as a package which besides other files files also installs Java metadata as an additional file.
    • Field Detail

      • metadata

        private final PackageMetadata metadata
        Metadata associated with this package.
      • basePackageName

        private final java.lang.String basePackageName
      • metadataDir

        private final java.nio.file.Path metadataDir
    • Constructor Detail

      • JavaPackage

        public JavaPackage​(java.lang.String id,
                           java.lang.String basePackageName,
                           java.nio.file.Path metadataDir)
        Create an empty Java package with given ID.
        Parameters:
        id - package ID
        basePackageName - name of the source package
        metadataDir - installation directory for metadata relative to installation root
    • Method Detail

      • getSplitMetadata

        private PackageMetadata getSplitMetadata​(java.lang.String namespace)
        Create metadata contents split by namespace, so that artifacts with different namespaces don't have conflicting metadata files.
        Parameters:
        namespace - namespace name
        Returns:
        new metadata with subset of artifacts
      • getMetadataContents

        private byte[] getMetadataContents​(java.lang.String namespace)
      • getNamespaces

        private java.util.Set<java.lang.String> getNamespaces()
      • getFiles

        public java.util.Set<File> getFiles()
        Description copied from class: Package
        Get files contained in this package.
        Overrides:
        getFiles in class Package
        Returns:
        list view of files that will be installed with this package
      • getMetadata

        public PackageMetadata getMetadata()
        Get metadata associated with this package.
        Returns:
        package metadata object