|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jguild.jrpm.io.RPMFile
public class RPMFile
This class allows IO access to an RPM file.
Field Summary | |
---|---|
static java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
RPMFile()
Creates a new empty RPMFile object. |
|
RPMFile(java.io.File fh)
Creates a new RPMFile object out of a file. |
Method Summary | |
---|---|
void |
close()
Release locked resources. |
RPMHeader |
getHeader()
Get the header section of this rpm file. |
static java.lang.String[] |
getKnownTagNames()
Get all known tags of this rpm file. |
RPMLead |
getLead()
Get the lead section of this rpm file |
java.lang.String[] |
getLocales()
Return all known locales that are supported by this RPM file. |
RPMSignature |
getSignature()
Get the signature section of this rpm file |
DataTypeIf |
getTag(long tag)
Get a tag by id as a long |
DataTypeIf |
getTag(java.lang.Long tag)
Get a tag by id as a Long |
DataTypeIf |
getTag(java.lang.String tagname)
Get a tag by name |
long |
getTagIdForName(java.lang.String tagname)
Read a tag with a given tag name. |
long[] |
getTagIds()
Get all tag ids contained in this rpm file. |
java.lang.String |
getTagNameForId(long tagid)
Read a tag with a given tag id. |
java.lang.String[] |
getTagNames()
Get all tag names contained in this rpm file. |
static RPMFile |
loadUsingNative(java.io.File file)
Load an RPM file using the native rpm executables. |
void |
parse()
Parse the RPMFile and will extract all informations. |
void |
setFile(java.io.File fh)
Set the file this RPMFile should represent |
void |
setLocale(int pos)
Set the locale as int for all I18N strings that are returned by getTag(). |
void |
setLocale(java.lang.String locale)
Set the locale as string for all I18N strings that are returned by getTag(). |
java.lang.String |
toXML()
Same as doing toXML(true). |
java.lang.String |
toXML(boolean excludePayload)
Returns an XML version of this file |
void |
toXML(java.io.Writer writer,
boolean excludePayload)
Outputs this rpm in an XML format to the specified i/o writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.logging.Logger logger
Constructor Detail |
---|
public RPMFile()
public RPMFile(java.io.File fh)
fh
- The file object representing a rpm fileMethod Detail |
---|
public void setFile(java.io.File fh)
fh
- The file object representing a rpm filepublic void parse() throws java.io.IOException
java.io.IOException
- If an error occurs during read of the rpm filepublic RPMHeader getHeader()
public static java.lang.String[] getKnownTagNames()
public RPMLead getLead()
public void setLocale(int pos)
pos
- The position in the array returned by getLocales().public void setLocale(java.lang.String locale)
locale
- A locale matching a locale returned by getLocales()
java.lang.IllegalArgumentException
- If the locale is not defined by getLocales().public java.lang.String[] getLocales()
public RPMSignature getSignature()
public DataTypeIf getTag(java.lang.Long tag)
tag
- A tag id as a Long
public DataTypeIf getTag(long tag)
tag
- A tag id as a long
public DataTypeIf getTag(java.lang.String tagname)
tagname
- A tag name
public long getTagIdForName(java.lang.String tagname)
tagname
- A RPM tag name
java.lang.IllegalArgumentException
- if the tag name was not foundHeader.getTagIdForName(String)
public long[] getTagIds()
public java.lang.String getTagNameForId(long tagid)
tagid
- A RPM tag id
java.lang.IllegalArgumentException
- if the tag id was not foundHeader.getTagNameForId(long)
public java.lang.String[] getTagNames()
public void close()
public java.lang.String toXML()
toXML(boolean)
public java.lang.String toXML(boolean excludePayload)
excludePayload
- If this is true, the payload will not be included in the XML.
public void toXML(java.io.Writer writer, boolean excludePayload) throws java.io.IOException
writer
- Writer stream.excludePayload
- If this is true, the payload will not be included in the XML.
java.io.IOException
- If an error occurred writing to the writer.public static RPMFile loadUsingNative(java.io.File file)
file
- RPM file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |