|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.freecompany.redline.payload.Contents
public class Contents
The contents of an RPM archive. These entries define the files and links that the RPM contains as well as headers those files require. Note that the RPM format requires that files in the archive be naturally ordered.
| Field Summary | |
|---|---|
protected java.util.Set<java.lang.String> |
files
|
protected java.util.Set<CpioHeader> |
headers
|
protected java.util.Map<CpioHeader,java.lang.Object> |
sources
|
| Constructor Summary | |
|---|---|
Contents()
|
|
| Method Summary | |
|---|---|
static void |
addBuiltinDirectory(java.lang.String directory)
Add additional directory that is assumed to already exist on system where the RPM will be installed (e.g. |
void |
addDirectory(java.lang.String path)
Adds a directory entry to the archive with the default permissions of 644. |
void |
addDirectory(java.lang.String path,
Directive directive)
Adds a directory entry to the archive with the default permissions of 644. |
void |
addDirectory(java.lang.String path,
int permissions)
Adds a directory entry to the archive with the specified permissions. |
void |
addDirectory(java.lang.String path,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname)
Adds a directory entry to the archive with the specified permissions. |
void |
addDirectory(java.lang.String path,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname,
boolean addParents)
Adds a directory entry to the archive with the specified permissions. |
void |
addFile(java.lang.String path,
java.io.File source)
Adds a file entry to the archive with the default permissions of 644. |
void |
addFile(java.lang.String path,
java.io.File source,
int permissions)
Adds a file entry to the archive with the specified permissions. |
void |
addFile(java.lang.String path,
java.io.File source,
int permissions,
Directive directive)
Adds a file entry to the archive with the specified permissions. |
void |
addFile(java.lang.String path,
java.io.File source,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname)
Adds a file entry to the archive with the specified permissions. |
void |
addFile(java.lang.String path,
java.io.File source,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname,
int dirmode)
Adds a file entry to the archive with the specified permissions. |
void |
addFile(java.lang.String path,
java.io.File source,
int permissions,
int dirmode)
Adds a file entry to the archive with the specified permissions. |
void |
addLink(java.lang.String path,
java.lang.String target)
Adds a directory entry to the archive with the default permissions of 644. |
void |
addLink(java.lang.String path,
java.lang.String target,
int permissions)
Adds a directory entry to the archive with the specified permissions. |
protected void |
addParents(java.io.File file,
int permissions,
java.lang.String uname,
java.lang.String gname)
Adds entries for parent directories of this file, so that they may be cleaned up when removing the package. |
void |
addURL(java.lang.String path,
java.net.URL source,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname,
int dirmode)
Adds a URL entry to the archive with the specified permissions. |
java.lang.String[] |
getBaseNames()
Gets the basenames header values. |
int[] |
getClasses()
Gets the classes header values. |
int[] |
getColors()
Gets the colors header values. |
java.lang.String[] |
getContexts()
Gets the contexts header values. |
int[] |
getDependsN()
Gets the dependsn header values. |
int[] |
getDependsX()
Gets the dependsx header values. |
int[] |
getDevices()
Gets the devices header values. |
int[] |
getDirIndexes()
Gets the dirindexes headers values. |
java.lang.String[] |
getDirNames()
Gets the dirnames headers values. |
int[] |
getFlags()
Gets the flags header values. |
java.lang.String[] |
getGroups()
Gets the groups header values. |
int[] |
getInodes()
Gets the inodes header values. |
java.lang.String[] |
getLangs()
Gets the langs header values. |
java.lang.String[] |
getLinkTos()
Gets the linktos header values. |
java.lang.String[] |
getMD5s()
Caclulates an MD5 hash for each file in the archive. |
short[] |
getModes()
Gets the modes header values. |
int[] |
getMtimes()
Gets the mtimes header values. |
short[] |
getRdevs()
Gets the rdevs header values. |
int[] |
getSizes()
Gets the sizes header values. |
java.lang.Object |
getSource(CpioHeader header)
Retrieves the content for this archive entry, which may be a File if the entry is a regular file or
a CharSequence containing the name of the target path if the entry is a link. |
int |
getTotalSize()
Accumulated size of all files included in the archive. |
java.lang.String[] |
getUsers()
Gets the users header values. |
int[] |
getVerifyFlags()
Gets the verifyflags header values. |
java.lang.Iterable<CpioHeader> |
headers()
Retrieve the archive headers. |
protected static void |
listParents(java.util.List<java.lang.String> parents,
java.io.File file)
Generates a list of parent paths given a starting path. |
int |
size()
Retrieve the size of this archive in number of files. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Set<CpioHeader> headers
protected final java.util.Set<java.lang.String> files
protected final java.util.Map<CpioHeader,java.lang.Object> sources
| Constructor Detail |
|---|
public Contents()
| Method Detail |
|---|
public void addLink(java.lang.String path,
java.lang.String target)
path - the destination path for the installed file.
public void addLink(java.lang.String path,
java.lang.String target,
int permissions)
path - the destination path for the installed file.permissions - the permissions flags.public void addDirectory(java.lang.String path)
path - the destination path for the installed file.
public void addDirectory(java.lang.String path,
Directive directive)
path - the destination path for the installed file.directive - directive indicating special handling for this directory.
public void addDirectory(java.lang.String path,
int permissions)
path - the destination path for the installed file.permissions - the permissions flags.
public void addDirectory(java.lang.String path,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname)
path - the destination path for the installed file.permissions - the permissions flags.directive - directive indicating special handling for this directory.uname - user owner for the given filegname - group owner for the given file
public void addDirectory(java.lang.String path,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname,
boolean addParents)
path - the destination path for the installed file.permissions - the permissions flags.directive - directive indicating special handling for this directory.uname - user owner for the given filegname - group owner for the given fileaddParents - whether to add parent directories to the rpm
public void addFile(java.lang.String path,
java.io.File source)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the local file to be included in the package.
java.io.FileNotFoundException
public void addFile(java.lang.String path,
java.io.File source,
int permissions)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the local file to be included in the package.permissions - the permissions flags.
java.io.FileNotFoundException
public void addFile(java.lang.String path,
java.io.File source,
int permissions,
int dirmode)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the local file to be included in the package.permissions - the permissions flags.
java.io.FileNotFoundException
public void addFile(java.lang.String path,
java.io.File source,
int permissions,
Directive directive)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the local file to be included in the package.permissions - the permissions flags.directive - directive indicating special handling for this file.
java.io.FileNotFoundException
public void addFile(java.lang.String path,
java.io.File source,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the local file to be included in the package.permissions - the permissions flags.directive - directive indicating special handling for this file.uname - user owner for the given filegname - group owner for the given file
java.io.FileNotFoundException
public void addFile(java.lang.String path,
java.io.File source,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname,
int dirmode)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the local file to be included in the package.permissions - the permissions flags.directive - directive indicating special handling for this file.uname - user owner for the given filegname - group owner for the given file
java.io.FileNotFoundException
public void addURL(java.lang.String path,
java.net.URL source,
int permissions,
Directive directive,
java.lang.String uname,
java.lang.String gname,
int dirmode)
throws java.io.FileNotFoundException
path - the destination path for the installed file.source - the URL with the data to be addedpermissions - the permissions flags.directive - directive indicating special handling for this file.uname - user owner for the given filegname - group owner for the given file
java.io.FileNotFoundException
protected void addParents(java.io.File file,
int permissions,
java.lang.String uname,
java.lang.String gname)
public static void addBuiltinDirectory(java.lang.String directory)
directory - public int size()
public java.lang.Iterable<CpioHeader> headers()
Iterable will iterate in the correct order for
the final archive.
public java.lang.Object getSource(CpioHeader header)
File if the entry is a regular file or
a CharSequence containing the name of the target path if the entry is a link. This is the value to
be written to the archive as the body of the entry.
public int getTotalSize()
public java.lang.String[] getDirNames()
public int[] getDirIndexes()
public java.lang.String[] getBaseNames()
public int[] getSizes()
public short[] getModes()
public short[] getRdevs()
public int[] getMtimes()
public java.lang.String[] getMD5s()
throws java.io.FileNotFoundException,
java.security.NoSuchAlgorithmException,
java.io.IOException
java.io.FileNotFoundException
java.security.NoSuchAlgorithmException
java.io.IOExceptionpublic java.lang.String[] getLinkTos()
public int[] getFlags()
public java.lang.String[] getUsers()
public java.lang.String[] getGroups()
public int[] getColors()
public int[] getVerifyFlags()
public int[] getClasses()
public int[] getDevices()
public int[] getInodes()
public java.lang.String[] getLangs()
public int[] getDependsX()
public int[] getDependsN()
public java.lang.String[] getContexts()
protected static void listParents(java.util.List<java.lang.String> parents,
java.io.File file)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||