summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/services
diff options
context:
space:
mode:
authormconway <michael.c.conway@gmail.com>2012-12-11 17:50:44 (GMT)
committer mconway <michael.c.conway@gmail.com>2012-12-11 17:50:44 (GMT)
commita8470fb469d9b367973be75e2375b8ddaa47bc11 (patch)
tree76fc8715315a91edcf00689958b4fe78a6483bf9 /idrop-web/grails-app/services
parentefe16935d6394c1d83e2cd69016fce488730affd (diff)
downloadQCG-Data-a8470fb469d9b367973be75e2375b8ddaa47bc11.zip
QCG-Data-a8470fb469d9b367973be75e2375b8ddaa47bc11.tar.gz
QCG-Data-a8470fb469d9b367973be75e2375b8ddaa47bc11.tar.bz2
[#984] adding starring of files and collections
Diffstat (limited to 'idrop-web/grails-app/services')
-rw-r--r--idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy32
1 files changed, 32 insertions, 0 deletions
diff --git a/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy b/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy
new file mode 100644
index 0000000..13f8f1d
--- /dev/null
+++ b/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy
@@ -0,0 +1,32 @@
+package org.irods.mydrop.service
+
+import org.irods.jargon.core.connection.IRODSAccount
+import org.irods.jargon.core.exception.JargonException
+import org.irods.jargon.core.pub.IRODSAccessObjectFactory
+import org.irods.jargon.usertagging.domain.IRODSStarredFileOrCollection
+import org.irods.jargon.usertagging.starring.IRODSStarringService
+import org.irods.jargon.usertagging.starring.IRODSStarringServiceImpl
+
+/**
+ * Service to 'star' or favorite folders and files
+ * @author Mike Conway - DICE (www.irods.org)
+ *
+ */
+class StarringService {
+
+ static transactional = false
+ IRODSAccessObjectFactory irodsAccessObjectFactory
+
+
+ IRODSStarredFileOrCollection findStarred(IRODSAccount irodsAccount, String irodsAbsolutePath) throws FileNotFoundException, JargonException {
+
+ if (irodsAccount == null) {
+ throw new IllegalArgumentException("null irodsAccount");
+ }
+
+ IRODSStarringService irodsStarringService = new IRODSStarringServiceImpl(irodsAccessObjectFactory, irodsAccount)
+ return irodsStarringService.findStarredForAbsolutePath(irodsAbsolutePath)
+
+ }
+}
+ \ No newline at end of file