SmartSync 1.1

li.netcat.smartsync
Class Task

java.lang.Object
  |
  +--li.netcat.smartsync.Task

public class Task
extends java.lang.Object

Immutable class, that represents an operation. Each task is associated with a verb, a file name and a transfer size. The Task object is only intended for monitoring purposes.

Author:
Arthur Marxer

Field Summary
static java.lang.String CREATE_VERB
          This verb specifies a task that creates a new file in the work directory.
static java.lang.String DELETE_VERB
          This verb specifies a task that deletes a file from the work directory.
static java.lang.String KEEP_VERB
          This verb specifies a task that copies a file from the archive directory to the work directory.
static java.lang.String RESUMECREATE_VERB
          This verb specifies a task that resumes the creation of a new file in the work directory.
static java.lang.String RESUMEKEEP_VERB
          This verb specifies a task that resumes the copy of a file from the archive directory to the work directory.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getFullName()
          Returns the full name of the associated file (with path).
 java.lang.String getName()
          Returns the name of the associated file without the path.
 java.lang.String getPath()
          Returns the path of the associated file.
 long getTransferLength()
          Returns the number of bytes that must be transferred to complete the task.
 java.lang.String getVerb()
          Returns the verb of the task, i.e. one of the constants *_VERB.
 int hashCode()
           
 boolean isTransferTask()
          Returns true, if this task is a transfer task, i.e. data of the file content must be transferred to complete the operation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEEP_VERB

public static final java.lang.String KEEP_VERB
This verb specifies a task that copies a file from the archive directory to the work directory.

RESUMEKEEP_VERB

public static final java.lang.String RESUMEKEEP_VERB
This verb specifies a task that resumes the copy of a file from the archive directory to the work directory.

CREATE_VERB

public static final java.lang.String CREATE_VERB
This verb specifies a task that creates a new file in the work directory.

RESUMECREATE_VERB

public static final java.lang.String RESUMECREATE_VERB
This verb specifies a task that resumes the creation of a new file in the work directory.

DELETE_VERB

public static final java.lang.String DELETE_VERB
This verb specifies a task that deletes a file from the work directory.
Method Detail

getVerb

public java.lang.String getVerb()
Returns the verb of the task, i.e. one of the constants *_VERB. Be aware that further releases may extend the vocabulary.
Returns:
The verb of the task. This parameter is never null.

getPath

public java.lang.String getPath()
Returns the path of the associated file. The path is either an empty string or a string that ends with a slash. (e.g. "home/etc/")
Returns:
The path of the file.

getName

public java.lang.String getName()
Returns the name of the associated file without the path.
Returns:
The name of the file.

getFullName

public java.lang.String getFullName()
Returns the full name of the associated file (with path).
Returns:
The full name of the file.

getTransferLength

public long getTransferLength()
Returns the number of bytes that must be transferred to complete the task.
Returns:
The number of bytes that must be transferred to complete the task or -1 if this task is not a transfer task (e.g. delete a file);

isTransferTask

public boolean isTransferTask()
Returns true, if this task is a transfer task, i.e. data of the file content must be transferred to complete the operation.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SmartSync 1.1

Copyright © 2003 NetCat AG. All rights reserved. Feedback

keywords:java, net, servlet, synchronize, file, files, synchronize data, synchronize directory, synchronize files, synchronize files over HTTP, synchronize tree, file synchronizer, directory synchronizer, directory, directory structure, network, download, package, equalize, equalize, server, synchronise, file, files, synchronise data, synchronise directory, synchronise files, synchronise files over HTTP, synchronise tree, file synchroniser, file synchronisation, directory synchroniser, directory synchronisation, java, net, servlet, synchronize, file, files, synchronize data, synchronize directory, synchronize files, synchronize files over HTTP, synchronize tree, file synchronizer, directory synchronizer, directory, directory structure, network, download, package, equalize, equalize, server, synchronise, file, files, synchronise data, synchronise directory, synchronise files, synchronise files over HTTP, synchronise tree, file synchroniser, file synchronisation, directory synchroniser, directory synchronisation, java, net, servlet, synchronize, file, files, synchronize data, synchronize directory, synchronize files, synchronize files over HTTP, synchronize tree, file synchronizer, directory synchronizer, directory, directory structure, network, download, package, equalize, equalize, server, synchronise, file, files, synchronise data, synchronise directory, synchronise files, synchronise files over HTTP, synchronise tree, file synchroniser, file synchronisation, directory synchroniser, directory synchronisation