|
|||||||||
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.HashSet<java.lang.String> |
files
|
protected java.util.TreeSet<CpioHeader> |
headers
|
protected java.util.HashMap<CpioHeader,java.lang.Object> |
sources
|
Constructor Summary | |
---|---|
Contents()
|
Method Summary | |
---|---|
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 |
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. |
java.lang.String[] |
getBaseNames()
|
int[] |
getClasses()
|
int[] |
getColors()
|
java.lang.String[] |
getContexts()
|
int[] |
getDependsN()
|
int[] |
getDependsX()
|
int[] |
getDevices()
|
int[] |
getDirIndexes()
|
java.lang.String[] |
getDirNames()
|
int[] |
getFlags()
|
java.lang.String[] |
getGroups()
|
int[] |
getInodes()
|
java.lang.String[] |
getLangs()
|
java.lang.String[] |
getLinkTos()
|
java.lang.String[] |
getMD5s()
Caclulates an MD5 hash for each file in the archive. |
short[] |
getModes()
|
int[] |
getMtimes()
|
short[] |
getRdevs()
|
int[] |
getSizes()
|
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()
|
int[] |
getVerifyFlags()
|
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.TreeSet<CpioHeader> headers
protected final java.util.HashSet<java.lang.String> files
protected final java.util.HashMap<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 filepublic 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 rpmpublic 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, 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
protected void addParents(java.io.File file, int permissions, java.lang.String uname, java.lang.String gname)
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.IOException
public 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 |