summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormconway <michael_conway@unc.edu>2013-07-03 17:21:18 (GMT)
committer mconway <michael_conway@unc.edu>2013-07-03 17:21:18 (GMT)
commit745d3cb2de81501754c5b5406dd4bfb3dedb22a9 (patch)
tree15ce92e890bc4c4a9e9f8ae2132cc34ae516105e
parente003f9e72181705f8eb66dd53b80526f112799da (diff)
downloadQCG-Data-745d3cb2de81501754c5b5406dd4bfb3dedb22a9.zip
QCG-Data-745d3cb2de81501754c5b5406dd4bfb3dedb22a9.tar.gz
QCG-Data-745d3cb2de81501754c5b5406dd4bfb3dedb22a9.tar.bz2
[#1556] up/download performance of idrop web
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy12
-rw-r--r--idrop-web/release_notes.txt3
2 files changed, 12 insertions, 3 deletions
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy
index aca5fb5..971b89e 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy
@@ -71,7 +71,6 @@ class FileController {
fullPath = fullPath.substring(idx + parseStringLength)
log.info("iRODS path for file is: ${fullPath}")
-
try {
IRODSFileFactory irodsFileFactory = irodsAccessObjectFactory.getIRODSFileFactory(irodsAccount)
IRODSFileInputStream irodsFileInputStream = irodsFileFactory.instanceIRODSFileInputStream(fullPath)
@@ -84,7 +83,13 @@ class FileController {
response.setContentLength((int) length)
response.setHeader("Content-disposition", "attachment;filename=\"${irodsFile.name}\"")
- response.outputStream << irodsFileInputStream // Performing a binary stream copy
+ //response.outputStream << irodsFileInputStream // Performing a binary stream copy
+
+ Stream2StreamAO stream2Stream = irodsAccessObjectFactory.getStream2StreamAO(irodsAccount)
+ def stats = stream2Stream
+ .streamToStreamCopyUsingStandardIO(irodsFileInputStream, response.outputStream)
+ log.info("transferStats:${stats}")
+
} catch (CatNoAccessException e) {
log.error("no access error", e)
response.sendError(500, message(code:"message.no.access"))
@@ -194,7 +199,8 @@ class FileController {
IRODSFile targetFile = irodsFileFactory.instanceIRODSFile(irodsCollectionPath, name)
targetFile.setResource(irodsAccount.defaultStorageResource)
Stream2StreamAO stream2Stream = irodsAccessObjectFactory.getStream2StreamAO(irodsAccount)
- stream2Stream.transferStreamToFileUsingIOStreams(fis, targetFile, f.size, 0)
+ def transferStats = stream2Stream.transferStreamToFileUsingIOStreams(fis, targetFile, f.size, 0)
+ log.info("transferStats:${transferStats}")
} catch (NoResourceDefinedException nrd) {
log.error("no resource defined exception", nrd)
response.sendError(500, message(code:"message.no.resource"))
diff --git a/idrop-web/release_notes.txt b/idrop-web/release_notes.txt
index da2ee4d..ca0a6e8 100644
--- a/idrop-web/release_notes.txt
+++ b/idrop-web/release_notes.txt
@@ -73,3 +73,6 @@ Note that the following bug and feature requests are logged in GForge with relat
*[#1475] login form discombobulated on ie later versions
**Fix layout markup for login form for better cross-browser compatability
+
+*[#1556] up/download performance of idrop web
+**Use enhanced Stream2StreamAO stream copy methods for upload/download