[DS-182] Speed up SWORD deposits

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3711 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2009-04-13 19:52:28 +00:00
parent 9df41d355d
commit 04ecb2c5e9
2 changed files with 19 additions and 13 deletions

View File

@@ -214,18 +214,23 @@ public class DepositServlet extends HttpServlet {
// Write the file to the temp directory
filename = tempDirectory + "SWORD-"
+ request.getRemoteAddr() + "-" + counter.addAndGet(1);
InputStream inputStream = request.getInputStream();
OutputStream outputStream = new FileOutputStream(filename);
try {
int data;
while ((data = inputStream.read()) != -1) {
outputStream.write(data);
}
} finally {
inputStream.close();
outputStream.close();
}
InputStream inputstream = request.getInputStream();
OutputStream outputstream = new FileOutputStream(new File(filename));
try
{
byte[] buf = new byte[1024];
int len;
while ((len = inputstream.read(buf)) > 0)
{
outputstream.write(buf, 0, len);
}
}
finally
{
inputstream.close();
outputstream.close();
}
// Check the size is OK
File file = new File(filename);
long fLength = file.length() / 1024;

View File

@@ -38,7 +38,8 @@
- [2696133] New export option (migrate) and fix for Jira [DS-59]
- [DS-113] Export item buttons
- Fix for Jira [DS-127] Item exporter does not export bitsteam descriptions
- [DS-182] Speed up SWORD deposits
(Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini / Paulo Matos)
- [DS-16] [2057378] Hierarchical LDAP support