com.mindprod.filetransfer
Class MaxiFileTransfer

java.lang.Object
  extended by com.mindprod.filetransfer.MiniFileTransfer
      extended by com.mindprod.filetransfer.FileTransfer
          extended by com.mindprod.filetransfer.MaxiFileTransfer

public final class MaxiFileTransfer
extends FileTransfer

copy or download a file. To read or write from the client's local hard disk, you will need a signed Applet and.

security clearance. see Signed Applet in the Java glossary. To read a files from the server, the file must be given public read access, usually the default. To write a file to the server, you server will have to support CGI-PUT with public access. This is unusual to find. Normally you upload files with FTP. See FTP in the Java glossary.

military.

Since:
1999
Version:
2.5 2008-08-10 - add setReadTimeout and setConnectTimeout methods.
Author:
Roedy Green, Canadian Mind Products

Field Summary
 
Fields inherited from class com.mindprod.filetransfer.FileTransfer
EMBEDDED_COPYRIGHT, VERSION_STRING
 
Constructor Summary
MaxiFileTransfer()
          constructor
MaxiFileTransfer(int buffSize)
          constructor
 
Method Summary
static void main(java.lang.String[] args)
          Test driver
 boolean upload(java.io.File source, java.net.URL target)
          Copy a file from a local hard disk to a remote URL.
 
Methods inherited from class com.mindprod.filetransfer.FileTransfer
append, copy, copy, download, setStandardProperties
 
Methods inherited from class com.mindprod.filetransfer.MiniFileTransfer
copy, copy, copy, setConnectTimeout, setReadTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxiFileTransfer

public MaxiFileTransfer()
constructor


MaxiFileTransfer

public MaxiFileTransfer(int buffSize)
constructor

Parameters:
buffSize - how big the I/O chunks are to copy files.
Method Detail

upload

public boolean upload(java.io.File source,
                      java.net.URL target)
Copy a file from a local hard disk to a remote URL. This simulates the HTML PUT upload command. Unfortunately, most servers do not support it, or refuse it. WARNING: I have not tested this code is untested. I have no access to a server that supports PUT. WARNING: This code does not work in Netscape or IE. You must run it as a standalone application.

Parameters:
source - existing file to be copied on local hard disk.
target - remote URL to copy to. e.g. new URL("http://www.billabong.com:80/songs/lyrics.txt")
Returns:
true if the copy was successful.

main

public static void main(java.lang.String[] args)
Test driver

Parameters:
args - not used