summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/services
diff options
context:
space:
mode:
authormconway <michael.c.conway@gmail.com>2013-02-04 20:08:50 (GMT)
committer mconway <michael.c.conway@gmail.com>2013-02-04 20:08:50 (GMT)
commit03185adbd834e572ac631f761980b89dfa4bf1fe (patch)
treefbf352f3901c5668712fde46c80bec65477a16cc /idrop-web/grails-app/services
parent598f05b8c42301a40beea7d9def478c691698ceb (diff)
downloadQCG-Data-03185adbd834e572ac631f761980b89dfa4bf1fe.zip
QCG-Data-03185adbd834e572ac631f761980b89dfa4bf1fe.tar.gz
QCG-Data-03185adbd834e572ac631f761980b89dfa4bf1fe.tar.bz2
[#511] share crud done
Diffstat (limited to 'idrop-web/grails-app/services')
-rw-r--r--idrop-web/grails-app/services/org/irods/mydrop/service/SharingService.groovy27
1 files changed, 27 insertions, 0 deletions
diff --git a/idrop-web/grails-app/services/org/irods/mydrop/service/SharingService.groovy b/idrop-web/grails-app/services/org/irods/mydrop/service/SharingService.groovy
index b964ab3..ab13cd6 100644
--- a/idrop-web/grails-app/services/org/irods/mydrop/service/SharingService.groovy
+++ b/idrop-web/grails-app/services/org/irods/mydrop/service/SharingService.groovy
@@ -149,5 +149,32 @@ class SharingService {
irodsSharingService.updateShareName(irodsAbsolutePath, newShareName)
return irodsSharingService.findShareByAbsolutePath(irodsAbsolutePath)
}
+
+ /**
+ * Delete the share at the given path
+ * @param irodsAbsolutePath
+ * @param irodsAccount
+ * @return
+ * @throws JargonException
+ */
+ void deleteShare(String irodsAbsolutePath, IRODSAccount irodsAccount) throws JargonException {
+
+ log.info("deleteShare()")
+ if (irodsAbsolutePath == null || irodsAbsolutePath.isEmpty()) {
+ throw new IllegalArgumentException("null or empty irodsAbsolutePath")
+ }
+
+
+ if (irodsAccount == null) {
+ throw new IllegalArgumentException("null irodsAccount");
+ }
+
+
+ log.info("share to delete:${irodsAbsolutePath}")
+ IRODSSharingService irodsSharingService = new IRODSSharingServiceImpl(irodsAccessObjectFactory, irodsAccount)
+ irodsSharingService.removeShare(irodsAbsolutePath)
+ log.info("share removed")
+ }
+
}