public class Builder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<Dependency> |
conflicts |
protected Contents |
contents |
protected Format |
format |
protected AbstractHeader.Entry<byte[]> |
immutable |
protected List<Dependency> |
obsoletes |
protected org.bouncycastle.openpgp.PGPPrivateKey |
privateKey |
protected String |
privateKeyId |
protected String |
privateKeyPassphrase |
protected File |
privateKeyRingFile |
protected Map<String,Dependency> |
provides |
protected List<Dependency> |
requires |
protected AbstractHeader.Entry<byte[]> |
signature |
protected Set<PrivateKey> |
signatures |
protected List<Integer> |
triggerflags |
protected List<Integer> |
triggerindexes |
protected List<String> |
triggernames |
protected List<String> |
triggerscriptprogs |
protected List<String> |
triggerscripts |
protected List<String> |
triggerversions |
| Constructor and Description |
|---|
Builder()
Initializes the builder and sets some required fields to known values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBuiltinDirectory(String builtinDirectory) |
void |
addChangelogFile(File changelogFile)
Adds the supplied Changelog file as a Changelog to the header
|
protected void |
addConflicts(CharSequence name,
CharSequence version,
int flag) |
void |
addConflicts(String name,
int comparison,
String version) |
void |
addConflictsLess(CharSequence name,
CharSequence version) |
void |
addConflictsMore(CharSequence name,
CharSequence version) |
protected void |
addDependency(CharSequence name,
CharSequence version,
int flag)
Adds a dependency to the RPM package.
|
void |
addDependency(String name,
int comparison,
String version)
Adds a dependency to the RPM package.
|
void |
addDependencyLess(CharSequence name,
CharSequence version)
Adds a dependency to the RPM package.
|
void |
addDependencyMore(CharSequence name,
CharSequence version)
Adds a dependency to the RPM package.
|
void |
addDirectory(String path)
Adds the directory to the repository with the default mode of
644. |
void |
addDirectory(String path,
Directive directive)
Adds the directory to the repository with the default mode of
644. |
void |
addDirectory(String path,
int permissions,
Directive directive,
String uname,
String gname)
Adds the directory to the repository.
|
void |
addDirectory(String path,
int permissions,
Directive directive,
String uname,
String gname,
boolean addParents)
Adds the directory to the repository.
|
void |
addFile(String path,
File source)
Adds the file to the repository with the default mode of
644. |
void |
addFile(String path,
File source,
int mode)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
Directive directive)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
Directive directive,
String uname,
String gname)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
int dirmode)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
int dirmode,
Directive directive,
String uname,
String gname)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
int dirmode,
Directive directive,
String uname,
String gname,
boolean addParents)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
int dirmode,
Directive directive,
String uname,
String gname,
boolean addParents,
int verifyFlags)
Add the specified file to the repository payload in order.
|
void |
addFile(String path,
File source,
int mode,
int dirmode,
String uname,
String gname)
Add the specified file to the repository payload in order.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
byte value)
Adds a header entry byte (8-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
byte[] value)
Adds a header entry byte array (8-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
char value)
Adds a header entry char (8-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
int value)
Adds a header entry int (32-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
int[] value)
Adds a header entry int (32-bit) array value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
long value)
Adds a header entry long (64-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
long[] value)
Adds a header entry long (64-bit) array value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
short value)
Adds a header entry short (16-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
short[] value)
Adds a header entry short array (16-bit) value to the header.
|
void |
addHeaderEntry(AbstractHeader.Tag tag,
String value)
Adds a header entry value to the header.
|
void |
addLink(String path,
String target)
Adds a symbolic link to the repository.
|
void |
addLink(String path,
String target,
int permissions)
Adds a symbolic link to the repository.
|
void |
addLink(String path,
String target,
int permissions,
String username,
String groupname)
Adds a symbolic link to the repository.
|
protected void |
addObsoletes(CharSequence name,
CharSequence version,
int flag) |
void |
addObsoletes(String name,
int comparison,
String version) |
void |
addObsoletesLess(CharSequence name,
CharSequence version) |
void |
addObsoletesMore(CharSequence name,
CharSequence version) |
protected void |
addProvides(CharSequence name,
CharSequence version,
int flag) |
void |
addProvides(String name,
String version) |
void |
addSignature(PrivateKey key)
Add a key to generate a new signature for the header and payload portions of the
rpm file.
|
void |
addTrigger(File script,
String prog,
Map<String,IntString> depends,
int flag)
Adds a trigger to the RPM package.
|
void |
addURL(String path,
URL source,
int mode,
int dirmode)
Add the specified file to the repository payload in order by URL.
|
void |
addURL(String path,
URL source,
int mode,
int dirmode,
Directive directive,
String username,
String group)
Add the specified file to the repository payload in order by URL.
|
void |
addURL(String path,
URL source,
int mode,
int dirmode,
String username,
String group)
Add the specified file to the repository payload in order by URL.
|
String |
build(File directory)
Generates an RPM with a standard name consisting of the RPM package name, version, release,
and type in the given directory.
|
void |
build(FileChannel original)
Generates the rpm file to the provided file channel.
|
protected int[] |
convert(Integer[] ints)
Converts an array of Integer objects into an equivalent
array of int primitives.
|
protected SignatureGenerator |
createSignatureGenerator() |
protected byte[] |
getImmutable(int count) |
protected byte[] |
getSignature(int count) |
protected byte[] |
getSpecial(int tag,
int count)
Returns the special header expected by RPM for
a particular header.
|
static OutputStream |
nullOutputStream() |
void |
setBuildHost(CharSequence host)
Required Field.
|
void |
setDescription(CharSequence description)
Required Field.
|
void |
setDistribution(CharSequence distribution)
Required Field.
|
void |
setFiles(Contents contents)
Sets the group of contents to include in this RPM.
|
void |
setGroup(CharSequence group)
Required Field.
|
void |
setLicense(CharSequence license)
Required Field.
|
void |
setPackage(CharSequence name,
CharSequence version,
CharSequence release) |
void |
setPackage(CharSequence name,
CharSequence version,
CharSequence release,
int epoch)
Required Field.
|
void |
setPackager(CharSequence packager)
Required Field.
|
void |
setPlatform(Architecture arch,
CharSequence osName)
Required Field.
|
void |
setPlatform(Architecture arch,
Os os)
Required Field.
|
void |
setPostInstallProgram(String program)
Declares the interpreter to be used when invoking the RPM
post-installation script that can be set with the
setPostInstallScript(String) method. |
void |
setPostInstallScript(File file)
Declares a script file to be run as part of the RPM post-installation.
|
void |
setPostInstallScript(String script)
Declares a script to be run as part of the RPM post-installation.
|
void |
setPostTransProgram(String program)
Declares the interpreter to be used when invoking the RPM
post-transaction script that can be set with the
setPostTransScript(String) method. |
void |
setPostTransScript(File file)
Declares a script file to be run as part of the RPM post-transaction.
|
void |
setPostTransScript(String script)
Declares a script to be run as part of the RPM post-transaction.
|
void |
setPostUninstallProgram(String program)
Declares the interpreter to be used when invoking the RPM
post-uninstallation script that can be set with the
setPostUninstallScript(String) method. |
void |
setPostUninstallScript(File file)
Declares a script file to be run as part of the RPM post-uninstallation.
|
void |
setPostUninstallScript(String script)
Declares a script to be run as part of the RPM post-uninstallation.
|
void |
setPrefixes(String... prefixes)
Sets the package prefix directories to allow any files installed under
them to be relocatable.
|
void |
setPreInstallProgram(String program)
Declares the interpreter to be used when invoking the RPM
pre-installation script that can be set with the
setPreInstallScript(String) method. |
void |
setPreInstallScript(File file)
Declares a script file to be run as part of the RPM pre-installation.
|
void |
setPreInstallScript(String script)
Declares a script to be run as part of the RPM pre-installation.
|
void |
setPreTransProgram(String program)
Declares the interpreter to be used when invoking the RPM
pre-transaction script that can be set with the
setPreTransScript(String) method. |
void |
setPreTransScript(File file)
Declares a script file to be run as part of the RPM pre-transaction.
|
void |
setPreTransScript(String script)
Declares a script to be run as part of the RPM pre-transaction.
|
void |
setPreUninstallProgram(String program)
Declares the interpreter to be used when invoking the RPM
pre-uninstallation script that can be set with the
setPreUninstallScript(String) method. |
void |
setPreUninstallScript(File file)
Declares a script file to be run as part of the RPM pre-uninstallation.
|
void |
setPreUninstallScript(String script)
Declares a script to be run as part of the RPM pre-uninstallation.
|
void |
setPrivateKey(org.bouncycastle.openpgp.PGPPrivateKey privateKey)
Sets the private key for header and payload signing directly.
|
void |
setPrivateKeyId(String privateKeyId)
Selects a private key from the current
private key ring file. |
void |
setPrivateKeyPassphrase(String privateKeyPassphrase)
Passphrase for the private key
|
void |
setPrivateKeyRingFile(File privateKeyRingFile)
Sets the PGP key ring file used for header and header + payload signature.
|
void |
setProvides(CharSequence provides)
Declares a dependency that this package exports, and that other packages can use to
provide library functions.
|
void |
setSourceRpm(String rpm)
Adds a source rpm.
|
void |
setSummary(CharSequence summary)
Required Field.
|
void |
setType(RpmType type)
Required Field.
|
void |
setUrl(CharSequence url)
Required Field.
|
void |
setVendor(CharSequence vendor)
Required Field.
|
protected final Format format
protected final Set<PrivateKey> signatures
protected final List<Dependency> requires
protected final List<Dependency> obsoletes
protected final List<Dependency> conflicts
protected final Map<String,Dependency> provides
protected final AbstractHeader.Entry<byte[]> signature
protected final AbstractHeader.Entry<byte[]> immutable
protected Contents contents
protected File privateKeyRingFile
protected String privateKeyId
protected String privateKeyPassphrase
protected org.bouncycastle.openpgp.PGPPrivateKey privateKey
public Builder()
public void addBuiltinDirectory(String builtinDirectory)
public void addObsoletesLess(CharSequence name, CharSequence version)
public void addObsoletesMore(CharSequence name, CharSequence version)
protected void addObsoletes(CharSequence name, CharSequence version, int flag)
public void addConflictsLess(CharSequence name, CharSequence version)
public void addConflictsMore(CharSequence name, CharSequence version)
protected void addConflicts(CharSequence name, CharSequence version, int flag)
protected void addProvides(CharSequence name, CharSequence version, int flag)
public void addDependency(String name, int comparison, String version)
name - the name of the dependency.comparison - the comparison flag.version - the version identifier.public void addDependencyLess(CharSequence name, CharSequence version)
name - the name of the dependency.version - the version identifier.public void addDependencyMore(CharSequence name, CharSequence version)
name - the name of the dependency.version - the version identifier.protected void addDependency(CharSequence name, CharSequence version, int flag)
name - the name of the dependency.version - the version identifier.flag - the file flagspublic void addHeaderEntry(AbstractHeader.Tag tag, String value)
tag - the header tag to setvalue - the value to set the header entry withpublic void addHeaderEntry(AbstractHeader.Tag tag, byte value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not byte[]public void addHeaderEntry(AbstractHeader.Tag tag, char value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not byte[]public void addHeaderEntry(AbstractHeader.Tag tag, short value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not short[]public void addHeaderEntry(AbstractHeader.Tag tag, int value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not int[]public void addHeaderEntry(AbstractHeader.Tag tag, long value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not long[]public void addHeaderEntry(AbstractHeader.Tag tag, byte[] value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not byte[]public void addHeaderEntry(AbstractHeader.Tag tag, short[] value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not short[]public void addHeaderEntry(AbstractHeader.Tag tag, int[] value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not int[]public void addHeaderEntry(AbstractHeader.Tag tag, long[] value)
tag - the header tag to setvalue - the value to set the header entry withClassCastException - - if the type required by tag.type() is not long[]public void setPackage(CharSequence name, CharSequence version, CharSequence release, int epoch)
name - the name of the RPM package.version - the version of the new package.release - the release number, specified after the version, of the new RPM.epoch - the epoch number of the new RPMIllegalArgumentException - if version or release contain
dashes, as they are explicitly disallowed by RPM file format.public void setPackage(CharSequence name, CharSequence version, CharSequence release)
public void setType(RpmType type)
type - the type of RPM to generate.public void setPlatform(Architecture arch, Os os)
arch - the target architecture.os - the target operating system.public void setPlatform(Architecture arch, CharSequence osName)
arch - the target architecture.osName - the non-standard target operating system.public void setSummary(CharSequence summary)
summary - summary text.public void setDescription(CharSequence description)
description - description text.public void setBuildHost(CharSequence host)
host - hostname of the build machine.public void setLicense(CharSequence license)
license - the chosen distribution license.public void setGroup(CharSequence group)
group - target group.public void setDistribution(CharSequence distribution)
distribution - the distribution.public void setVendor(CharSequence vendor)
vendor - software vendor.public void setPackager(CharSequence packager)
packager - packager name.public void setUrl(CharSequence url)
url - the URLpublic void setProvides(CharSequence provides)
addProvides() methods.
You should use addProvides() instead.provides - dependency provided by this package.public void setFiles(Contents contents)
addFile() methods.contents - the set of contents to use in constructing this RPM.public void setSourceRpm(String rpm)
rpm - name of rpm source filepublic void setPrefixes(String... prefixes)
prefixes - Path prefixes which may be relocatedpublic void setPreTransScript(String script)
setPreTransProgram(String) method.script - Script contents to run (i.e. shell commands)public void setPreTransScript(File file) throws IOException
setPreTransProgram(String) method.file - Script to run (i.e. shell commands)IOException - there was an IO errorpublic void setPreTransProgram(String program)
setPreTransScript(String) method.program - Path to the interpreterpublic void setPreInstallScript(String script)
setPreInstallProgram(String) method.script - Script contents to run (i.e. shell commands)public void setPreInstallScript(File file) throws IOException
setPreInstallProgram(String) method.file - Script to run (i.e. shell commands)IOException - there was an IO errorpublic void setPreInstallProgram(String program)
setPreInstallScript(String) method.program - Path to the interpretterpublic void setPostInstallScript(String script)
setPostInstallProgram(String) method.script - Script contents to run (i.e. shell commands)public void setPostInstallScript(File file) throws IOException
setPostInstallProgram(String) method.file - Script to run (i.e. shell commands)IOException - there was an IO errorpublic void setPostInstallProgram(String program)
setPostInstallScript(String) method.program - Path to the interpreterpublic void setPreUninstallScript(String script)
setPreUninstallProgram(String) method.script - Script contents to run (i.e. shell commands)public void setPreUninstallScript(File file) throws IOException
setPreUninstallProgram(String) method.file - Script to run (i.e. shell commands)IOException - there was an IO errorpublic void setPreUninstallProgram(String program)
setPreUninstallScript(String) method.program - Path to the interpreterpublic void setPostUninstallScript(String script)
setPostUninstallProgram(String) method.script - Script contents to run (i.e. shell commands)public void setPostUninstallScript(File file) throws IOException
setPostUninstallProgram(String) method.file - Script contents to run (i.e. shell commands)IOException - there was an IO errorpublic void setPostUninstallProgram(String program)
setPostUninstallScript(String) method.program - Path to the interpreterpublic void setPostTransScript(String script)
setPostTransProgram(String) method.script - Script contents to run (i.e. shell commands)public void setPostTransScript(File file) throws IOException
setPostTransProgram(String) method.file - Script contents to run (i.e. shell commands)IOException - there was an IO errorpublic void setPostTransProgram(String program)
setPostTransScript(String) method.program - Path to the interpreterpublic void addTrigger(File script, String prog, Map<String,IntString> depends, int flag) throws IOException
script - the script to add.prog - the interpreter with which to run the script.depends - the map of rpms and versions that will trigger the scriptflag - the trigger type (SCRIPT_TRIGGERPREIN, SCRIPT_TRIGGERIN, SCRIPT_TRIGGERUN, or SCRIPT_TRIGGERPOSTUN)IOException - there was an IO errorpublic void addFile(String path, File source, int mode) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, int dirmode) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirmode - the mode of the parent directories in standard three octet notation, or -1 for default.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, int dirmode, String uname, String gname) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirmode - the mode of the parent directories in standard three octet notation, or -1 for default.uname - user owner for the given filegname - group owner for the given fileNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, int dirmode, Directive directive, String uname, String gname) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirmode - the mode of the parent directories in standard three octet notation, or -1 for default.directive - directive indicating special handling for this file.uname - user owner for the given filegname - group owner for the given fileNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, int dirmode, Directive directive, String uname, String gname, boolean addParents) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notation, or -1 for default.dirmode - the mode of the parent directories in standard three octet notation, or -1 for default.directive - directive indicating special handling for this file.uname - user owner for the given file, or null for default user.gname - group owner for the given file, or null for default group.addParents - whether to create parent directories for the file, defaults to true for other methods.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, int dirmode, Directive directive, String uname, String gname, boolean addParents, int verifyFlags) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notation, or -1 for default.dirmode - the mode of the parent directories in standard three octet notation, or -1 for default.directive - directive indicating special handling for this file.uname - user owner for the given file, or null for default user.gname - group owner for the given file, or null for default group.addParents - whether to create parent directories for the file, defaults to true for other methods.verifyFlags - verify flagsNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, Directive directive, String uname, String gname) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirective - directive indicating special handling for this file.uname - user owner for the given filegname - group owner for the given fileNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source, int mode, Directive directive) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirective - directive indicating special handling for this file.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addFile(String path, File source) throws NoSuchAlgorithmException, IOException
644.path - the absolute path at which this file will be installed.source - the file content to include in this rpm.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addURL(String path, URL source, int mode, int dirmode) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirmode - the mode of the parent directories in standard three octet notation, or -1 for default.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addURL(String path, URL source, int mode, int dirmode, String username, String group) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirmode - the mode of the parent directories in standard three octet notation, or -1 for default.username - ownership of added filegroup - ownership of added fileNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addURL(String path, URL source, int mode, int dirmode, Directive directive, String username, String group) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this file will be installed.source - the file content to include in this rpm.mode - the mode of the target file in standard three octet notationdirmode - the mode of the parent directories in standard three octet notation, or -1 for default.directive - directive indicating special handling for this file.username - ownership of added filegroup - ownership of added fileNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addDirectory(String path) throws NoSuchAlgorithmException, IOException
644.path - the absolute path to add as a directory.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addDirectory(String path, int permissions, Directive directive, String uname, String gname) throws NoSuchAlgorithmException, IOException
path - the absolute path to add as a directory.permissions - the mode of the directory in standard three octet notation.directive - directive indicating special handling for this file.uname - user owner of the directorygname - group owner of the directoryNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addDirectory(String path, int permissions, Directive directive, String uname, String gname, boolean addParents) throws NoSuchAlgorithmException, IOException
path - the absolute path to add as a directory.permissions - the mode of the directory in standard three octet notation.directive - directive indicating special handling for this file.uname - user owner of the directorygname - group owner of the directoryaddParents - whether to add parent directories to the rpmNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addDirectory(String path, Directive directive) throws NoSuchAlgorithmException, IOException
644.path - the absolute path to add as a directory.directive - directive indicating special handling for this file.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addLink(String path, String target) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this link will be installed.target - the path of the file this link will point to.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addLink(String path, String target, int permissions) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this link will be installed.target - the path of the file this link will point to.permissions - the permissions flagsNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addLink(String path, String target, int permissions, String username, String groupname) throws NoSuchAlgorithmException, IOException
path - the absolute path at which this link will be installed.target - the path of the file this link will point to.permissions - the permissions flagsusername - user owner of the linkgroupname - group owner of the linkNoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void addSignature(PrivateKey key)
key - private key to use in generating a signature.public void addChangelogFile(File changelogFile) throws IOException, ChangelogParseException
changelogFile - File containing the Changelog informationIOException - if file does not exist or cannot be readChangelogParseException - if file is not of the correct format.public void setPrivateKeyRingFile(File privateKeyRingFile)
setPrivateKey(org.bouncycastle.openpgp.PGPPrivateKey)privateKeyRingFile - the private key ring filepublic void setPrivateKeyId(String privateKeyId)
private key ring file.
If no key is specified, the first signing key will be selected.privateKeyId - hex key idpublic void setPrivateKeyPassphrase(String privateKeyPassphrase)
privateKeyPassphrase - the private key pass phrasepublic void setPrivateKey(org.bouncycastle.openpgp.PGPPrivateKey privateKey)
key ring file, key id
and passphrase directly. Setting the private key has more
priorisation than providing key ring file.privateKey - the PGP private keypublic String build(File directory) throws NoSuchAlgorithmException, IOException
directory - the destination directory for the new RPM file.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorpublic void build(FileChannel original) throws NoSuchAlgorithmException, IOException
RandomAccessFile, otherwise an IOException will be
generated.original - the FileChannel to which the resulting RPM will be written.NoSuchAlgorithmException - the algorithm isn't supportedIOException - there was an IO errorprotected SignatureGenerator createSignatureGenerator()
protected byte[] getSignature(int count)
protected byte[] getImmutable(int count)
protected byte[] getSpecial(int tag,
int count)
tag - the tag to getcount - the number to getprotected int[] convert(Integer[] ints)
ints - the array of Integer objectspublic static OutputStream nullOutputStream()
Copyright © 2021. All Rights Reserved.