org.codehaus.mojo.rpm
Class Mapping

java.lang.Object
  extended by org.codehaus.mojo.rpm.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.

Version:
$Id: Mapping.java 18186 2013-04-12 08:36:36Z afloom $

Constructor Summary
Mapping()
           
 
Method Summary
 ArtifactMap getArtifact()
          Retrieve the artifact specification.
 String getAttrString(String defaultFileMode, String defaultGrp, String defaultUsr)
          Assemble the RPM SPEC file attributes for a mapping.
 String getConfiguration()
          Retrieves the configuration value.
 Dependency getDependency()
          Retrieve the dependency specification.
 String getDestination()
          Return the destination directory name.
 String getDirectory()
          Retrieve the destination during package installation.
 String getFilemode()
          Retrieve the UNIX file permissions.
 String getGroupname()
          Retrieve the UNIX group name to own the installed files.
 List getSources()
          Retrieve the list of source file specifications.
 String getUsername()
          Retrieve the UNIX user name to own the installed files.
 boolean isConfiguration()
          Deprecated. use getConfiguration()
 boolean isDirectoryIncluded()
          Returns if the getDirectory() should be used for the attribute string (if and only if sources make up everything that gets copied to the directory).
 boolean isDirOnly()
          Return directory-only status.
 boolean isDocumentation()
          Retrieve the documentation status.
 boolean isRecurseDirectories()
          Indicates if sub-directories contained in the getSources() should be explicitly listed in %files.
 void setArtifact(ArtifactMap am)
          Set the artifact specification.
 void setConfiguration(String cfg)
          Set the configuration status.
 void setDependency(Dependency am)
          Set the dependency specification.
 void setDirectory(String dir)
          Set the destination during package installation.
 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).
 void setDocumentation(boolean isDoc)
          Set the documentation status.
 void setFilemode(String fmode)
          Set the UNIX file permissions.
 void setGroupname(String grpname)
          Set the UNIX group name to own the installed files.
 void setRecurseDirectories(boolean recurseDirectories)
          Indicates if sub-directories contained in the getSources() should be explicitly listed in %files.
 void setSources(List srclist)
          Set the list of source file specifications.
 void setUsername(String uname)
          Set the UNIX user name to own the installed files.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.

isDirectoryIncluded

public boolean isDirectoryIncluded()
Returns 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 returns true.

Returns:
Whether the getDirectory() should be used for the attribute string.

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.

isConfiguration

public boolean isConfiguration()
Deprecated. use getConfiguration()

Retrieve the configuration status. This value is true if the file(s) in this mapping are configuration files.

Returns:
The configuration status.

getConfiguration

public String getConfiguration()
Retrieves the configuration value. This may be just a string representation of isConfiguration(). 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 getSources()
Retrieve the list of source file specifications.

Returns:
The list of source file specifications.

setSources

public void setSources(List 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.

isRecurseDirectories

public final boolean isRecurseDirectories()
Indicates if sub-directories contained in the getSources() should be explicitly listed in %files. This includes listing the getDestination(), if isDirectoryIncluded() is true.

Returns:
Returns the recurseDirectories.
Since:
2.1-alpha-1

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

public String getAttrString(String defaultFileMode,
                            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.
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.

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

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2005-2013 Codehaus. All Rights Reserved.