|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.clApp.uploader.UploaderProps
final class UploaderProps
Holder for uploader mutable persistent properties, preferences, etc. Holds a small amount of structured information that can be persisted from one uploader run to the next.
Is thread-safe, though using multiple threads at once, especially mutators, may be confusing.
Not designed to be Serialisable, but instead can be stored in the plain-text Java properties format.
Is designed to be GUI-free.
Package visible since need be seen only by the main GUI class.
TODO: ADD locale
TODO: ADD upload category / main words / number-in-series / type / description
| Field Summary | |
|---|---|
private boolean |
changed
Internal flag to note if any flags have changed. |
private java.io.File |
fileChooserPathHint
File chooser directory hint, or null. |
static int |
MAX_PERS_BYTES
Maximum length (in bytes) expected necessary to persist this data; strictly positive. |
private java.lang.String |
userID
User ID (author initials), initially null; null or valid author initials. |
| Constructor Summary | |
|---|---|
UploaderProps()
|
|
| Method Summary | |
|---|---|
java.io.File |
getFileChooserPathHint()
Get the file chooser directory hint, or null. |
byte[] |
getPersistentData()
Get data in properties-file format byte[]; never null. |
byte[] |
getPersistentDataIfChanged()
Get data in properties file if properties have changes, else null. |
java.lang.String |
getUserID()
Get the user ID (author initials), initially null; null or valid author initials. |
void |
loadFromPersistentData(java.io.InputStream is)
Load from previously-generated persistent data format. |
void |
setFileChooserPathHint(java.io.File pathHint)
Set the file chooser directory hint, or null. |
void |
setUserID(java.lang.String authInitials)
Set the user ID (author initials), null or valid author initials. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_PERS_BYTES
private volatile boolean changed
Because of possible races this cannot be guaranteed to catch all changes, so a final "save-on-exit" and/or periodic save would be valuable.
private volatile java.lang.String userID
Volatile for thread-safe access without a lock.
private volatile java.io.File fileChooserPathHint
Volatile for thread-safe access without a lock.
| Constructor Detail |
|---|
UploaderProps()
| Method Detail |
|---|
public java.lang.String getUserID()
public void setUserID(java.lang.String authInitials)
public java.io.File getFileChooserPathHint()
public void setFileChooserPathHint(java.io.File pathHint)
public byte[] getPersistentData()
public byte[] getPersistentDataIfChanged()
public void loadFromPersistentData(java.io.InputStream is)
throws java.io.IOException
All updates are done as if through the setXXX() members to validate/coerce them, concurrently with other use of this instance.
java.io.IOException
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||