com.partnersoft.v3x.net
Class GuppyClient

java.lang.Object
  extended by com.partnersoft.v3x.net.GuppyClient
All Implemented Interfaces:
GuppyConstants

public class GuppyClient
extends java.lang.Object
implements GuppyConstants

A "simple" file upload and download system. This is the client.


Nested Class Summary
 class GuppyClient.GuppyByeCommand
           
 class GuppyClient.GuppyChecksumHeaderCommand
           
 class GuppyClient.GuppyCompressOffCommand
           
 class GuppyClient.GuppyCompressOnCommand
           
 class GuppyClient.GuppyDeleteCommand
           
 class GuppyClient.GuppyDownloadCommand
           
 class GuppyClient.GuppyDownloadStreamCommand
           
 class GuppyClient.GuppyFileExistsCommand
           
 class GuppyClient.GuppyMessageCommand
           
 class GuppyClient.GuppySyncCommand
           
 class GuppyClient.GuppyUploadCommand
           
 class GuppyClient.GuppyUploadStreamCommand
           
 
Field Summary
static int SYNC_FREQUENCY
           
 
Fields inherited from interface com.partnersoft.v3x.net.GuppyConstants
COMMAND_BYE, COMMAND_CHECKSUM, COMMAND_COMPRESS_OFF, COMMAND_COMPRESS_ON, COMMAND_DATA, COMMAND_DELETE, COMMAND_FILE_EXISTS, COMMAND_GET, COMMAND_GET_CHECKSUM_HEADER, COMMAND_HEARTBEAT, COMMAND_MESSAGE, COMMAND_NODATA, COMMAND_NOK, COMMAND_OK, COMMAND_PUT, COMMAND_SYNC
 
Constructor Summary
GuppyClient(java.net.Socket socket)
           
GuppyClient(java.lang.String portedServerAddress)
           
GuppyClient(java.lang.String serverAddress, int serverPort)
           
 
Method Summary
 void close()
           
 void delete(java.lang.String path)
           
 void download(java.lang.String path)
           
 void download(java.lang.String path, AsynchronousStreamCopy copy)
           
 void download(java.lang.String path, java.io.File filet)
           
 boolean fileExists(java.lang.String path)
           
 long getChecksumHeader(java.lang.String path)
           
 boolean isCompressing()
           
 void message(java.lang.String message)
           
 void setCompressing(boolean tizit)
           
 void sync()
           
 void upload(java.lang.String path)
           
 void upload(java.lang.String path, AsynchronousStreamCopy copy)
           
 void upload(java.lang.String path, java.io.File filet)
           
 void uploadTree(java.io.File source, java.lang.String destination)
          Uploads an entire directory tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNC_FREQUENCY

public static final int SYNC_FREQUENCY
See Also:
Constant Field Values
Constructor Detail

GuppyClient

public GuppyClient(java.lang.String portedServerAddress)
            throws java.io.IOException
Throws:
java.io.IOException

GuppyClient

public GuppyClient(java.lang.String serverAddress,
                   int serverPort)
            throws java.io.IOException
Throws:
java.io.IOException

GuppyClient

public GuppyClient(java.net.Socket socket)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

upload

public void upload(java.lang.String path)
            throws java.io.IOException
Throws:
java.io.IOException

upload

public void upload(java.lang.String path,
                   java.io.File filet)
            throws java.io.IOException
Throws:
java.io.IOException

upload

public void upload(java.lang.String path,
                   AsynchronousStreamCopy copy)
            throws java.io.IOException
Throws:
java.io.IOException

download

public void download(java.lang.String path)
              throws java.io.IOException
Throws:
java.io.IOException

delete

public void delete(java.lang.String path)
            throws java.io.IOException
Throws:
java.io.IOException

download

public void download(java.lang.String path,
                     java.io.File filet)
              throws java.io.IOException
Throws:
java.io.IOException

download

public void download(java.lang.String path,
                     AsynchronousStreamCopy copy)
              throws java.io.IOException
Throws:
java.io.IOException

message

public void message(java.lang.String message)
             throws java.io.IOException
Throws:
java.io.IOException

getChecksumHeader

public long getChecksumHeader(java.lang.String path)
                       throws java.io.IOException
Throws:
java.io.IOException

fileExists

public boolean fileExists(java.lang.String path)
                   throws java.io.IOException
Throws:
java.io.IOException

sync

public void sync()
          throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

isCompressing

public boolean isCompressing()

setCompressing

public void setCompressing(boolean tizit)
                    throws java.io.IOException
Throws:
java.io.IOException

uploadTree

public void uploadTree(java.io.File source,
                       java.lang.String destination)
                throws java.io.IOException
Uploads an entire directory tree. It will become a subdir of the given destination.

Throws:
java.io.IOException