public class Package extends Object
Constructor and Description |
---|
Package(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.
|
boolean |
equals(Object rhs) |
Set<File> |
getFiles()
Get files contained in this package.
|
String |
getId()
Get unique string identifying this package.
|
int |
hashCode() |
void |
install(Path installRoot)
Install this package into specified root.
|
String |
toString() |
void |
writeDescriptor(Path descriptorPath)
Write package descriptor (aka
mfiles ) into specified file. |
public static String MAIN
public Package(String id)
id
- package IDpublic String getId()
public Set<File> getFiles()
public void addFile(File file)
file
- file to be addedpublic void install(Path installRoot) throws 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 installedIOException
public void writeDescriptor(Path descriptorPath) throws IOException
mfiles
) into specified file.
If target file exists then it shall be overwritten.
descriptorPath
- path to file into which descriptor shall be writtenIOException
Copyright © 2012-2017 Red Hat, Inc.. All Rights Reserved.