Class Mapping


  • public class Mapping
    extends Object
    A description of a file or directory to be installed. It includes the properties to be assigned and the location(s) where the file(s) can be found for packaging.
    • Constructor Detail

      • Mapping

        public Mapping()
    • Method Detail

      • getDirectory

        public String getDirectory()
        Retrieve the destination during package installation.
        Returns:
        The destination during package installation.
      • setDirectory

        public void setDirectory​(String dir)
        Set the destination during package installation.
        Parameters:
        dir - The new destination during package installation.
      • setDirectoryIncluded

        public void setDirectoryIncluded​(boolean directoryIncluded)
        Sets if the getDirectory() should be used for the attribute string (if and only if sources make up everything that gets copied to the directory).
        By default, this is true.
        Parameters:
        directoryIncluded - The directoryIncluded to set.
      • getConfiguration

        public String getConfiguration()
        Retrieves the configuration value. This may be just a string representation of getConfiguration(). However, modifications to the %config declaration (such as noreplace) are allowed.
        Returns:
        The configuration value.
      • setConfiguration

        public void setConfiguration​(String cfg)
        Set the configuration status. This value is true if the file(s) in this mapping are configuration files. Any value other than true or false will be considered a modifier of the %config declaration in the spec file.
        Parameters:
        cfg - The new configuration value.
      • isDocumentation

        public boolean isDocumentation()
        Retrieve the documentation status. This value is true if the file(s) in this mapping are documentation files.
        Returns:
        The documentation status.
      • setDocumentation

        public void setDocumentation​(boolean isDoc)
        Set the documentation status. This value is true if the file(s) in this mapping are documentation files.
        Parameters:
        isDoc - The new documentation status.
      • getFilemode

        public String getFilemode()
        Retrieve the UNIX file permissions. This is a three-digit octal number which specifies the permissions to be applied to each file in the mapping when it is installed.
        Returns:
        The UNIX file permissions.
      • setFilemode

        public void setFilemode​(String fmode)
        Set the UNIX file permissions. This is a three-digit octal number which specifies the permissions to be applied to each file in the mapping when it is installed.
        Parameters:
        fmode - The new UNIX file permissions.
      • getUsername

        public String getUsername()
        Retrieve the UNIX user name to own the installed files. Note that this must be a name, not a numeric user ID.
        Returns:
        The UNIX user name to own the installed files.
      • setUsername

        public void setUsername​(String uname)
        Set the UNIX user name to own the installed files. Note that this must be a name, not a numeric user ID.
        Parameters:
        uname - The new UNIX user name to own the installed files.
      • getGroupname

        public String getGroupname()
        Retrieve the UNIX group name to own the installed files. Note that this must be a name, not a numeric group ID.
        Returns:
        The UNIX group name to own the installed files.
      • setGroupname

        public void setGroupname​(String grpname)
        Set the UNIX group name to own the installed files. Note that this must be a name, not a numeric group ID. Indicates if sub-directories contained in the getSources() should be explicitly listed in %files .
        Parameters:
        grpname - The new UNIX group name to own the installed files.
      • getSources

        public List<Source> getSources()
        Retrieve the list of source file specifications.
        Returns:
        The list of source file specifications.
      • setSources

        public void setSources​(List<Source> srclist)
        Set the list of source file specifications.
        Parameters:
        srclist - The new list of source file specifications.
      • getArtifact

        public ArtifactMap getArtifact()
        Retrieve the artifact specification.
        Returns:
        The artifact specification.
      • setArtifact

        public void setArtifact​(ArtifactMap am)
        Set the artifact specification.
        Parameters:
        am - The new artifact specification.
      • getDependency

        public Dependency getDependency()
        Retrieve the dependency specification.
        Returns:
        The dependency specification.
      • setDependency

        public void setDependency​(Dependency am)
        Set the dependency specification.
        Parameters:
        am - The new dependency specification.
      • setRecurseDirectories

        public final void setRecurseDirectories​(boolean recurseDirectories)
        Indicates if sub-directories contained in the getSources() should be explicitly listed in %files . This includes listing the getDestination(), if isDirectoryIncluded() is true.
        Parameters:
        recurseDirectories - The recurseDirectories to set.
        Since:
        2.1-alpha-1
      • getAttrString

        @Deprecated
        public String getAttrString​(String defaultFileMode,
                                    String defaultGrp,
                                    String defaultUsr)
        Deprecated.
        Use getAttrString(String, String, String, String) instead (additionally includes defaultDirMode)
        Assemble the RPM SPEC file attributes for a mapping.
        Parameters:
        defaultFileMode - Default file mode to use if not set for this mapping.
        defaultGrp - Default group to use if not set for this mapping.
        defaultUsr - Default user to use if not set for this mapping.
        Returns:
        The attribute string for the SPEC file.
      • getAttrString

        public String getAttrString​(String defaultFileMode,
                                    String defaultDirMode,
                                    String defaultGrp,
                                    String defaultUsr)
        Assemble the RPM SPEC file attributes for a mapping.
        Parameters:
        defaultFileMode - Default file mode to use if not set for this mapping.
        defaultDirMode - Default directory mode to use if not set for this mapping.
        defaultGrp - Default group to use if not set for this mapping.
        defaultUsr - Default user to use if not set for this mapping.
        Returns:
        The attribute string for the SPEC file. Includes %dir for directory-only entries.
      • getDerivedDirAttrString

        public String getDerivedDirAttrString​(String defaultDirMode,
                                              String defaultGrp,
                                              String defaultUsr)
        Assemble RPM SPEC directory attributes for a mapping. Used if a mapping results in both directory and file SPEC entries.
        Parameters:
        defaultDirMode - Default directory mode if not set for this mapping.
        defaultGrp - Default group to use if not set for this mapping.
        defaultUsr - Default user to use if not set for this mapping.
        Returns:
        The attribute string for the SPEC file. Includes %dir
      • getDestination

        public String getDestination()
        Return the destination directory name.
        Returns:
        The name of the destination directory.
      • isDirOnly

        public boolean isDirOnly()
        Return directory-only status.
        Returns:
        true if no sources were specified in the mapping
      • isSourceDirsOnly

        public boolean isSourceDirsOnly()
        Return source with directories only status.
        Returns:
        true if no sources were specified in the mapping
      • isSoftLinkOnly

        public boolean isSoftLinkOnly()
        Return directory-only status.
        Returns:
        true if no sources were specified in the mapping