Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Types | |
enum | Purpose { ACTIVITY, RECOVERY } |
enum | Type { CREATED, REMOVED, MOVED } |
Public Member Functions | |
FileActivity (User source, Type type, SPath newPath, SPath oldPath, byte[] content, String encoding, Purpose purpose) | |
boolean | isValid () |
SPath | getOldPath () |
Type | getType () |
byte[] | getContent () |
String | getEncoding () |
String | toString () |
int | hashCode () |
boolean | equals (Object obj) |
void | dispatch (IActivityReceiver receiver) |
boolean | isRecovery () |
Static Public Member Functions | |
static FileActivity | created (User source, SPath path, byte[] content, String encoding, Purpose purpose) |
static FileActivity | moved (User source, SPath destPath, SPath sourcePath, byte[] content, String encoding) |
static FileActivity | removed (User source, SPath path, Purpose purpose) |
Protected Attributes | |
final SPath | oldPath |
final Type | type |
final Purpose | purpose |
String | encoding |
final byte[] | content |
de.fu_berlin.inf.dpp.activities.FileActivity.FileActivity | ( | User | source, |
Type | type, | ||
SPath | newPath, | ||
SPath | oldPath, | ||
byte[] | content, | ||
String | encoding, | ||
Purpose | purpose | ||
) |
Generic constructor for FileActivitys
source | the user who is the source (originator) of this Activity |
newPath | where to save the data (if Type#CREATED), destination of a move (if Type#MOVED), file to remove (if Type#REMOVED); never null |
oldPath | if type is Type#MOVED, the path from where the file was moved (null otherwise) |
content | content of the file denoted by the path (only valid for Type#CREATED and Type#MOVED) |
encoding | the encoding the content is encoded with or null |
static FileActivity de.fu_berlin.inf.dpp.activities.FileActivity.created | ( | User | source, |
SPath | path, | ||
byte[] | content, | ||
String | encoding, | ||
Purpose | purpose | ||
) | [static] |
Utility method for creating a FileActivity of type Type#CREATED for a given path.
path | path referencing the newly created file |
content | content of the file denoted by the path |
encoding | the encoding the content is encoded with or null |
void de.fu_berlin.inf.dpp.activities.FileActivity.dispatch | ( | IActivityReceiver | receiver | ) |
boolean de.fu_berlin.inf.dpp.activities.FileActivity.equals | ( | Object | obj | ) |
Reimplemented from de.fu_berlin.inf.dpp.activities.AbstractResourceActivity.
byte [] de.fu_berlin.inf.dpp.activities.FileActivity.getContent | ( | ) |
null
if not available Important: the content of the array must not be changed
String de.fu_berlin.inf.dpp.activities.FileActivity.getEncoding | ( | ) |
Returns the encoding the content is encoded with.
null
if it is not available SPath de.fu_berlin.inf.dpp.activities.FileActivity.getOldPath | ( | ) |
Returns the old/source path in case this Activity represents a moving of files.
Type de.fu_berlin.inf.dpp.activities.FileActivity.getType | ( | ) |
int de.fu_berlin.inf.dpp.activities.FileActivity.hashCode | ( | ) |
Reimplemented from de.fu_berlin.inf.dpp.activities.AbstractResourceActivity.
boolean de.fu_berlin.inf.dpp.activities.FileActivity.isRecovery | ( | ) |
boolean de.fu_berlin.inf.dpp.activities.FileActivity.isValid | ( | ) |
Reimplemented from de.fu_berlin.inf.dpp.activities.AbstractResourceActivity.
Reimplemented in de.fu_berlin.inf.dpp.activities.RecoveryFileActivity.
static FileActivity de.fu_berlin.inf.dpp.activities.FileActivity.moved | ( | User | source, |
SPath | destPath, | ||
SPath | sourcePath, | ||
byte[] | content, | ||
String | encoding | ||
) | [static] |
Builder for moving files (type Type#MOVED).
source | JID of the origin user |
destPath | path where the file moved to |
sourcePath | path where the file moved from |
content | content of the file denoted by the path, may be null to indicate that the file content was not changed when moved |
encoding | the encoding the content is encoded with or null |
static FileActivity de.fu_berlin.inf.dpp.activities.FileActivity.removed | ( | User | source, |
SPath | path, | ||
Purpose | purpose | ||
) | [static] |
Builder for removing files (type Type#REMOVED)
path | the path of the file to remove |
String de.fu_berlin.inf.dpp.activities.FileActivity.toString | ( | ) |
Reimplemented in de.fu_berlin.inf.dpp.activities.RecoveryFileActivity.
final byte [] de.fu_berlin.inf.dpp.activities.FileActivity.content [protected] |
String de.fu_berlin.inf.dpp.activities.FileActivity.encoding [protected] |
final SPath de.fu_berlin.inf.dpp.activities.FileActivity.oldPath [protected] |
final Purpose de.fu_berlin.inf.dpp.activities.FileActivity.purpose [protected] |
final Type de.fu_berlin.inf.dpp.activities.FileActivity.type [protected] |