|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.FileEncoding
public class FileEncoding
Represents an encoding of a chunk. A meta data will have collection of FileEncoding so that, when downloading the chunk, the tool will know how to process it to get the original bytes.
Note that order is significant. E.g., say a chunk has the following encodings: NONE, GZIP, and AES. This means that AES decryption was last applied (so much be handled first when downloading). Each FileEncoding has a hash associated with it to verify integrity.
| Field Summary | |
|---|---|
static java.lang.String |
AES
Representing a chunk's state after AES encryption applied. |
static java.lang.String |
GZIP
Representing a chunk's state after GZIP compression applied. |
static java.lang.String |
LZMA
Representing a chunk's state after LZMA compression applied. |
static java.lang.String |
NONE
Representing a chunk's state without any encodings. |
static java.lang.String |
PROP_HASH
Property key: used to get the hash value. |
static java.lang.String |
PROP_PASSPHRASE
Property key: used to get the passphrase value (if set). |
static java.lang.String |
PROP_TIMESTAMP_PUBLISHED
Property key: used to set when the passphrase was published. |
static java.lang.String |
TARBALL
Deprecated. Not in use. |
| Constructor Summary | |
|---|---|
FileEncoding(java.lang.String name,
BigHash mh)
|
|
FileEncoding(java.lang.String name,
java.util.Properties props)
|
|
| Method Summary | |
|---|---|
static FileEncoding |
createFromString(java.lang.String string)
Create a FileEncoding object from a string. |
boolean |
equals(java.lang.Object o)
|
BigHash |
getHash()
Get the BigHash associated with this FileEncoding. |
java.lang.String |
getName()
Get the name of the FileEncoding. |
java.util.Properties |
getProperties()
Properties object associated with FileEncoding. |
java.lang.String |
getProperty(java.lang.String name)
Get a property (value) using a key. |
void |
setName(java.lang.String name)
Set the name of the FileEncoding. |
void |
setProperties(java.util.Properties properties)
Properties object associated with FileEncoding. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property. |
java.lang.String |
toString()
Create a string representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String NONE
Representing a chunk's state without any encodings.
public static final java.lang.String LZMA
Representing a chunk's state after LZMA compression applied.
public static final java.lang.String GZIP
Representing a chunk's state after GZIP compression applied.
public static final java.lang.String AES
Representing a chunk's state after AES encryption applied.
public static final java.lang.String TARBALL
Representing a chunk (or collection of chunks) state after tarballed.
public static final java.lang.String PROP_HASH
Property key: used to get the hash value.
public static final java.lang.String PROP_PASSPHRASE
Property key: used to get the passphrase value (if set).
public static final java.lang.String PROP_TIMESTAMP_PUBLISHED
Property key: used to set when the passphrase was published.
| Constructor Detail |
|---|
public FileEncoding(java.lang.String name,
java.util.Properties props)
name - props -
public FileEncoding(java.lang.String name,
BigHash mh)
name - mh - | Method Detail |
|---|
public BigHash getHash()
Get the BigHash associated with this FileEncoding.
public java.lang.String getProperty(java.lang.String name)
Get a property (value) using a key.
name - Property key used to return the particular property value.
PROP_HASH,
PROP_PASSPHRASE
public void setProperty(java.lang.String name,
java.lang.String value)
Set a property. This property can be later retrieved using the name (key).
name - value - PROP_HASH,
PROP_PASSPHRASEpublic java.lang.String getName()
Get the name of the FileEncoding. Used to identify the type of encoding.
NONE,
AES,
GZIP,
LZMA,
TARBALLpublic void setName(java.lang.String name)
Set the name of the FileEncoding. Used to identify the type of encoding.
name - NONE,
AES,
GZIP,
LZMA,
TARBALLpublic java.util.Properties getProperties()
Properties object associated with FileEncoding.
PROP_HASH,
PROP_PASSPHRASEpublic void setProperties(java.util.Properties properties)
Properties object associated with FileEncoding.
properties - PROP_HASH,
PROP_PASSPHRASE,
PROP_TIMESTAMP_PUBLISHEDpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
Create a string representation. This can be saved and later restored.
toString in class java.lang.ObjectcreateFromString(java.lang.String)public static FileEncoding createFromString(java.lang.String string)
Create a FileEncoding object from a string.
string -
toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||