org.mycore.frontend.fileupload
Class MCRMetsModsCommunicator

java.lang.Object
  extended by org.mycore.frontend.fileupload.MCRMetsModsCommunicator

public class MCRMetsModsCommunicator
extends Object


Field Summary
protected static int bufferSize
           
protected  String uid
           
protected  String url
           
 
Constructor Summary
MCRMetsModsCommunicator(String url, String uploadId)
           
 
Method Summary
protected  String buildMD5StringByString(String mets)
          Calculates the MD5 checksum of the given mets file *
protected  void cancelUploadSession()
           
protected  long countTotalBytes(Vector files)
           
protected  InputStream doPost(Hashtable parameters)
           
protected  String encodeParameters(Hashtable parameters)
           
protected  void endUploadSession()
           
protected  Hashtable getResponse(InputStream is)
           
protected  Vector[] listFiles(File[] selectedFiles)
          Creates a list of all files in the given directories
protected  Object send(Hashtable parameters)
           
protected  void startUploadSession(int numFiles)
           
 void uploadFile(String path, String mets)
           
 void uploadMets(String mets_string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected String url

uid

protected String uid

bufferSize

protected static final int bufferSize
See Also:
Constant Field Values
Constructor Detail

MCRMetsModsCommunicator

public MCRMetsModsCommunicator(String url,
                               String uploadId)
Method Detail

uploadMets

public void uploadMets(String mets_string)

countTotalBytes

protected long countTotalBytes(Vector files)

uploadFile

public void uploadFile(String path,
                       String mets)
                throws Exception
Throws:
Exception

listFiles

protected Vector[] listFiles(File[] selectedFiles)
                      throws Exception
Creates a list of all files in the given directories

Parameters:
selectedFiles - list of selected files or directories from filechooser
Throws:
Exception

startUploadSession

protected void startUploadSession(int numFiles)
                           throws IOException,
                                  MCRUploadException
Throws:
IOException
MCRUploadException

endUploadSession

protected void endUploadSession()
                         throws IOException,
                                MCRUploadException
Throws:
IOException
MCRUploadException

cancelUploadSession

protected void cancelUploadSession()
                            throws IOException,
                                   MCRUploadException
Throws:
IOException
MCRUploadException

send

protected Object send(Hashtable parameters)
               throws IOException,
                      MCRUploadException
Throws:
IOException
MCRUploadException

doPost

protected InputStream doPost(Hashtable parameters)
                      throws IOException
Throws:
IOException

encodeParameters

protected String encodeParameters(Hashtable parameters)

getResponse

protected Hashtable getResponse(InputStream is)
                         throws IOException,
                                MCRUploadException
Throws:
IOException
MCRUploadException

buildMD5StringByString

protected String buildMD5StringByString(String mets)
                                 throws Exception
Calculates the MD5 checksum of the given mets file *

Throws:
Exception