Simias::Sync::SyncFile Class Reference

Class used to determine the common data between two files. This is done from a copy of the local file and a map of hash code for the server file. More...

Inheritance diagram for Simias::Sync::SyncFile:

Inheritance graph
[legend]
Collaboration diagram for Simias::Sync::SyncFile:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool IsEncryptionEnabled ()
 Test if encryption is enabled.
bool GetCryptoKey (out string EncryptionKey)
 Gets the crypto key.
void RemoveConflict (bool commit)
 Remove the exitsing conflict for the file.

Static Public Member Functions

static bool DoesNodeExist (Collection collection, DirNode parent, string name)
 Called to see if a node with the same name exists.
static void DeleteFile (Collection collection, BaseFileNode node, string path)
 Delete ther file and map file.
static bool IsNameValid (string name)
 Tests if the file name is valid.
static bool IsRelativePathValid (string path)
 Tests if the relative path is valid.

Static Public Attributes

static EventPublisher eventPublisher = new EventPublisher()
 Used to publish Sync events.

Protected Member Functions

 SyncFile (Collection collection)
 Constructor to create a sync file from collection.
void SetupFileNames (BaseFileNode node, string sessionID)
 Called to get the name of the file and workFile;.
bool CheckForNameConflict ()
 Checks for a name conflict.

Protected Attributes

bool stopping = false
 Used to signal to stop upload or downloading the file.
Collection collection
 The Collection the file belongs to.
BaseFileNode node
 The node that represents the file.
string nodeID
 The ID of the node.
const int MaxXFerSize = 1024 * 256
 The maximun size of a transfer.
string file
 The name of the actual file.
string workFile
 The name of the working file.
HashMap map
 The HashMap for this file.

Properties

bool NameConflict [get, set]
 Gets or Sets a NameConflict.
bool DateConflict [get, set]
 Gets or Sets a NameConflict.
string Name [get]
 Get the file name.
bool Stop [set]
 Tells the file to stop and return.


Detailed Description

Class used to determine the common data between two files. This is done from a copy of the local file and a map of hash code for the server file.


Constructor & Destructor Documentation

Simias::Sync::SyncFile::SyncFile ( Collection  collection  )  [inline, protected]

Constructor to create a sync file from collection.

Parameters:
collection The collection that the node belongs to.


Member Function Documentation

void Simias::Sync::SyncFile::SetupFileNames ( BaseFileNode  node,
string  sessionID 
) [inline, protected]

Called to get the name of the file and workFile;.

Parameters:
node The node that represents the file.
sessionID The unique session ID.

bool Simias::Sync::SyncFile::CheckForNameConflict (  )  [inline, protected]

Checks for a name conflict.

Returns:
True if conflict.

Set name conflict true if both file doesn't match

static bool Simias::Sync::SyncFile::DoesNodeExist ( Collection  collection,
DirNode  parent,
string  name 
) [inline, static]

Called to see if a node with the same name exists.

Parameters:
collection The collection that contains the node.
parent The parent node
name The leaf name of the file.
Returns:
true if allowed.

static void Simias::Sync::SyncFile::DeleteFile ( Collection  collection,
BaseFileNode  node,
string  path 
) [inline, static]

Delete ther file and map file.

Parameters:
collection The collection that the node belongs to.
node The node that represents the file.
path The full path to the file.

static bool Simias::Sync::SyncFile::IsNameValid ( string  name  )  [inline, static]

Tests if the file name is valid.

Parameters:
name The file name.
Returns:
true if valid.

static bool Simias::Sync::SyncFile::IsRelativePathValid ( string  path  )  [inline, static]

Tests if the relative path is valid.

Parameters:
path The path.
Returns:
true if valid

bool Simias::Sync::SyncFile::IsEncryptionEnabled (  )  [inline]

Test if encryption is enabled.

bool Simias::Sync::SyncFile::GetCryptoKey ( out string  EncryptionKey  )  [inline]

Gets the crypto key.

void Simias::Sync::SyncFile::RemoveConflict ( bool  commit  )  [inline]

Remove the exitsing conflict for the file.


Member Data Documentation

bool Simias::Sync::SyncFile::stopping = false [protected]

Used to signal to stop upload or downloading the file.

The Collection the file belongs to.

The node that represents the file.

string Simias::Sync::SyncFile::nodeID [protected]

The ID of the node.

const int Simias::Sync::SyncFile::MaxXFerSize = 1024 * 256 [protected]

The maximun size of a transfer.

string Simias::Sync::SyncFile::file [protected]

The name of the actual file.

The name of the working file.

The HashMap for this file.

Used to publish Sync events.


Property Documentation

bool Simias::Sync::SyncFile::NameConflict [get, set, protected]

Gets or Sets a NameConflict.

bool Simias::Sync::SyncFile::DateConflict [get, set, protected]

Gets or Sets a NameConflict.

string Simias::Sync::SyncFile::Name [get]

Get the file name.

bool Simias::Sync::SyncFile::Stop [set]

Tells the file to stop and return.


The documentation for this class was generated from the following file:

Generated on Wed Apr 8 14:57:36 2009 for simias by  doxygen 1.5.6