|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.clApp.uploader.SelectedFileDetails
final class SelectedFileDetails
Immutable class to hold details of one file selected. This is used during the selection/naming and upload phase.
All package-visible for access from the GUI classes.
Thread-safe.
The get/set status methods are dynamic and do not operate on the instance; the class holds a weak-ref map from selected file details to an optional String status/error, which "shadows" any computed error.
| Field Summary | |
|---|---|
static int |
COLNUM_BYTESLEN
Column for the (immutable) length in bytes. |
static int |
COLNUM_DESCRIPTION
Column for the (immutable) length in bytes. |
static int |
COLNUM_EXHIBIT_NAME
Column for the (potentially mutable) proposed exhibit name. |
static int |
COLNUM_LOCAL_FILE_NAME
Column for the (immutable) local filename. |
static int |
COLNUM_STATUS
Column for the (dynamic) status string. |
private java.lang.String |
description
Description; never null though may be "". |
private ExhibitStaticAttr |
esa
Proposed upload name/details (valid unique new exhibit name); never null. |
private javax.jnlp.FileContents |
fc
File on user side (should already be checked for validity); never null. |
private static java.lang.String[] |
fileLoadTableColNames
Column names for table, in order. |
private int |
hash
The cached instance hash value; the hash may be expensive to compute. |
private ROByteArray |
hashMD5
MD5 hash of exhibit content; never null. |
private java.lang.String |
localFilename
Local filename; never null (nor ""). |
private static java.util.Map<SelectedFileDetails,java.lang.String> |
notes
Global "error/status note" on instances of this class. |
| Constructor Summary | |
|---|---|
SelectedFileDetails(javax.jnlp.FileContents userFile,
java.lang.String putativeExhibitName,
java.lang.String description,
ROByteArray hashMD5)
Construct a new instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Equality is based on the (monocased) local filename and exhibit name. |
(package private) static int |
getColumnCount()
Return the number of columns; fixed for this model. |
(package private) static java.lang.String |
getColumnName(int col)
Return a column name, indexed from 0. |
(package private) java.lang.String |
getDescription()
Get the description; never null but may be "". |
(package private) ExhibitStaticAttr |
getEsa()
Get the static exhibit details; never null. |
(package private) javax.jnlp.FileContents |
getFc()
Get the FileContents; never null. |
(package private) ROByteArray |
getHashMD5()
Get the MD5 hash; never null. |
(package private) java.lang.String |
getLocalFilename()
Get the local filename; never null (nor ""). |
(package private) java.lang.String |
getStatus(UploaderLogic l)
Get status/error: if this returns null all is OK, else the error is described. |
(package private) java.lang.Object |
getValueAt(UploaderLogic l,
int col)
Get the value at the given column; null if none. |
int |
hashCode()
The hash code is based on the (monocased) local filename and exhibit name. |
(package private) void |
setStatus(java.lang.String n)
Set a status note for this item; use "" or null to clear. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int COLNUM_EXHIBIT_NAME
public static final int COLNUM_LOCAL_FILE_NAME
public static final int COLNUM_DESCRIPTION
public static final int COLNUM_BYTESLEN
public static final int COLNUM_STATUS
private static final java.lang.String[] fileLoadTableColNames
private final java.lang.String localFilename
private final javax.jnlp.FileContents fc
private final ExhibitStaticAttr esa
private final java.lang.String description
private final ROByteArray hashMD5
private transient int hash
private static final java.util.Map<SelectedFileDetails,java.lang.String> notes
Thread-safe.
| Constructor Detail |
|---|
SelectedFileDetails(javax.jnlp.FileContents userFile,
java.lang.String putativeExhibitName,
java.lang.String description,
ROByteArray hashMD5)
throws java.io.IOException
userFile - underlying (validated) user file; never nullputativeExhibitName - syntatically-valid proposed exhibit name;
never nulldescription - description text; may be "" but not nullhashMD5 - MD5 hash of exhibit content;
if null then it is computed here
java.io.IOException| Method Detail |
|---|
static int getColumnCount()
static java.lang.String getColumnName(int col)
java.lang.Object getValueAt(UploaderLogic l,
int col)
javax.jnlp.FileContents getFc()
java.lang.String getLocalFilename()
ExhibitStaticAttr getEsa()
java.lang.String getDescription()
ROByteArray getHashMD5()
void setStatus(java.lang.String n)
java.lang.String getStatus(UploaderLogic l)
If a note has been set it takes precedence over any computed value.
public boolean equals(java.lang.Object obj)
The MD5 hash is considered a feature of the content rather than of this object, and is not used in the object hash or equality.
equals in class java.lang.Objectpublic int hashCode()
The MD5 hash is considered a feature of the content rather than of this object, and is not used in the object hash or equality.
hashCode in class java.lang.Object
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||