From: Debashree P. <dp...@ol...> - 2009-03-06 17:51:19
|
Hi Stuart, I've been looking into the SWORD client source code lately. I have difficulty in figuring out one thing in the ServletClient.java. Since you are the author of the code, I am hoping you will be able to explain it. In the method doDeposit(), you are processing the file to be deposited in the following code segment: String fname = tempDirectory + File.separator + "ServletClient-" + counter++; if ((contentDisposition != null) && (!contentDisposition.equals(""))) { fname = tempDirectory + File.separator + contentDisposition; } File uploadedFile = new File(fname); item.write(uploadedFile); Here the tempDirectory is being set in the Init() method of the servlet. Since getServletContext().getInitParameter("upload-temp-directory") evaluates to null, the tempDirectory gets it's value from: tempDirectory = System.getProperty("java.io.tmpdir"); I printed out it's value, and it was set to: [tomcat]/webapps/works/xmlui/cocoons/files/ Hence, the fname came out as [tomcat]/webapps/works/xmlui/cocoons/files//ServletClient-0 or ...../ServletClient-1, etc. depending on the counter value. Why do you upload it to under xmlui? How does it go to the database from there? I will really appreciate some clarification on these. Ultimately, my goal is to: Allow users of our dspace repo. to remotely perform a bulk-submission using the SWORD webservice. Currently, your SWORD webservice is able to remotely post only a single file at a time. I am interested in modifying it so that it will be able to post multiple files. For example, I will have a test.zip directory (folder) that will contain several files like the example.zip (provided by you for testing). I want the user to enter the test.zip into the "Choose Package" field in depositform.jsp. When user clicks on the deposit button, I need to extract the zipped files from inside of test.zip one by one and process each for uploading and depositing. I believe, that I will have to work on ServletClient.java. Do you have any suggestions? Many thanks for taking the time to read the above, -Debashree |