JTwain v9 - Lab Asprise! All Rights Reserved.

com.asprise.util.jtwain.web
Class FileUploader

java.lang.Object
  extended bycom.asprise.util.jtwain.web.FileUploader

public class FileUploader
extends Object

File uploading utility.


Constructor Summary
FileUploader()
           
 
Method Summary
 String getProxyHost()
           
 int getProxyPort()
           
 void setProxyHost(String string)
           
 void setProxyPort(int i)
           
 void upload(String url, String parameterName, File file, Properties extraParams)
          Uploads a file with specified parameter name and optional extra parameters to a given URL.
 void upload(String targetURL, String parameterName, String fileName, File file, Properties extraParams)
          Uploads a file with specified parameter name and optional extra parameters to a given URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUploader

public FileUploader()
Method Detail

upload

public void upload(String url,
                   String parameterName,
                   File file,
                   Properties extraParams)
            throws IOException
Uploads a file with specified parameter name and optional extra parameters to a given URL.

Parameters:
url - the target URL
parameterName - the parameter name for the given file
file - file to be uploaded
extraParams - additional parameters in a Properties. Set to null to indicate no extra params.
Throws:
IOException

upload

public void upload(String targetURL,
                   String parameterName,
                   String fileName,
                   File file,
                   Properties extraParams)
            throws IOException
Uploads a file with specified parameter name and optional extra parameters to a given URL.

Parameters:
parameterName - the parameter name for the given file
fileName - file name to be changed to. set to null to use original file name.
file - file to be uploaded
extraParams - additional parameters in a Properties. Set to null to indicate no extra params.
Throws:
IOException

getProxyHost

public String getProxyHost()
Returns:

getProxyPort

public int getProxyPort()
Returns:

setProxyHost

public void setProxyHost(String string)
Parameters:
string -

setProxyPort

public void setProxyPort(int i)
Parameters:
i -

JTwain v9 - Lab Asprise! All Rights Reserved.