Class Package
- java.lang.Object
-
- org.fedoraproject.xmvn.tools.install.Package
-
- Direct Known Subclasses:
JavaPackage
public class Package extends java.lang.Object
Class describing a binary package as a set of files.- Author:
- Mikolaj Izdebski
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAIN
ID of main package.
-
Constructor Summary
Constructors Constructor Description Package(java.lang.String id)
Create an empty package with given ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 (akamfiles
) into specified file.
-
-
-
Field Detail
-
MAIN
public static final java.lang.String MAIN
ID of main package.- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Get unique string identifying this package.- Returns:
- package ID
-
getFiles
public java.util.Set<File> getFiles()
Get files contained in this package.- Returns:
- list view of files that will be installed with this package
-
addFile
public void addFile(File file)
Add a file to this package. The package must not already contains the file.- Parameters:
file
- file to be added
-
addFileIfNotExists
public void addFileIfNotExists(File file)
Add a file to this package if id doesn't already exist in the package.- Parameters:
file
- file to be added
-
install
public void install(java.nio.file.Path installRoot) throws java.io.IOException
Install this package into specified root.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.
- Parameters:
installRoot
- target directory where package files will be installed- Throws:
java.io.IOException
-
writeDescriptor
public void writeDescriptor(java.nio.file.Path descriptorPath) throws java.io.IOException
Write package descriptor (akamfiles
) into specified file.If target file exists then it shall be overwritten.
- Parameters:
descriptorPath
- path to file into which descriptor shall be written- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equals
in classjava.lang.Object
-
-