software.scanner
Class UploadEncBallots

java.lang.Object
  extended by software.scanner.UploadEncBallots

public class UploadEncBallots
extends java.lang.Object

Given a folder with scanned ballots, it upload them to a webserver

Author:
stefan

Constructor Summary
UploadEncBallots(java.lang.String password, java.lang.String host)
           
 
Method Summary
static void main(java.lang.String[] args)
          debug method
static java.lang.String prepareXMLforUpload(java.lang.String xml)
          Replaces the characters from an xml that are invalid to appear in an web address with escape characters.
 void upload(java.lang.String folder)
          Uploads a file or all the files in a folder (recursevly).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadEncBallots

public UploadEncBallots(java.lang.String password,
                        java.lang.String host)
                 throws java.security.NoSuchAlgorithmException,
                        javax.crypto.NoSuchPaddingException,
                        java.security.InvalidKeyException,
                        javax.xml.parsers.ParserConfigurationException
Parameters:
password - - can be null or have a lenght of zero, in which case the ballots are considered unencrypted
host - - the host where the ballots should uploaded
Throws:
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
javax.xml.parsers.ParserConfigurationException
Method Detail

upload

public void upload(java.lang.String folder)
            throws java.lang.Exception
Uploads a file or all the files in a folder (recursevly). One connection is oppened for each ballot. The content of the ballot is appended to the web link (HTTP GET style)

Parameters:
folder -
Throws:
java.lang.Exception

prepareXMLforUpload

public static java.lang.String prepareXMLforUpload(java.lang.String xml)
Replaces the characters from an xml that are invalid to appear in an web address with escape characters.

Parameters:
xml -
Returns:
A prepresentattion of the given parameter string, safe to use in a web link

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
debug method

Parameters:
args -
Throws:
java.lang.Exception