public class Package
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAIN
ID of main package.
|
Constructor and Description |
---|
Package(java.lang.String id)
Create an empty package with given ID.
|
Modifier and Type | Method and Description |
---|---|
void |
addFile(File file)
Add a file to this package.
|
void |
addFileIfNotExists(File file)
Add a file to this package if id doesn't already exist in the package.
|
boolean |
equals(java.lang.Object rhs) |
java.util.Set<File> |
getFiles()
Get files contained in this package.
|
java.lang.String |
getId()
Get unique string identifying this package.
|
int |
hashCode() |
void |
install(java.nio.file.Path installRoot)
Install this package into specified root.
|
java.lang.String |
toString() |
void |
writeDescriptor(java.nio.file.Path descriptorPath)
Write package descriptor (aka
mfiles ) into specified file. |
public static final java.lang.String MAIN
public Package(java.lang.String id)
id
- package IDpublic java.lang.String getId()
public java.util.Set<File> getFiles()
public void addFile(File file)
file
- file to be addedpublic void addFileIfNotExists(File file)
file
- file to be addedpublic void install(java.nio.file.Path installRoot) throws java.io.IOException
Package installation is equivalent to installation of all files it contains.
Target directory won't be overwritten if it already exists, which allows installation of multiple packages into the same directory.
installRoot
- target directory where package files will be installedjava.io.IOException
public void writeDescriptor(java.nio.file.Path descriptorPath) throws java.io.IOException
mfiles
) into specified file.
If target file exists then it shall be overwritten.
descriptorPath
- path to file into which descriptor shall be writtenjava.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object rhs)
equals
in class java.lang.Object
Copyright © 2012–2017 Red Hat, Inc.. All rights reserved.