[Yanel-commits] rev 21905 - public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources

michi at wyona.com michi at wyona.com
Fri Jan 19 00:45:53 CET 2007


Author: michi
Date: 2007-01-19 00:45:51 +0100 (Fri, 19 Jan 2007)
New Revision: 21905

Modified:
   public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarResource.java
Log:
return ICS if exists

Modified: public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarResource.java	2007-01-18 23:45:18 UTC (rev 21904)
+++ public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarResource.java	2007-01-18 23:45:51 UTC (rev 21905)
@@ -69,6 +69,24 @@
         log.error("DEBUG: " + categories + " " + classes + " " + userIds);
 
         org.wyona.yarep.core.Repository dataRepo = getRealm().getRepository();
+
+        if (dataRepo.exists(new org.wyona.yarep.core.Path(getPath().toString()))) {
+            log.error("DEBUG: ICS exists!");
+            if(viewId == null) {
+                View view = new View();
+                //view.setResponse(false);
+                String mimeType = getRTI().getProperty("mime-type");
+                if (mimeType != null) {
+	            view.setMimeType(mimeType);
+	        } else {
+	            view.setMimeType("text/calendar");
+                }
+	        view.setInputStream(dataRepo.getInputStream(new org.wyona.yarep.core.Path(getPath().toString())));
+                log.error("DEBUG: Return ICS!");
+                return view;
+            }
+        }
+
         String eventsPath = getRTI().getProperty("events-path");
         if (eventsPath == null) {
             eventsPath = getPath().toString();




More information about the Yanel-commits mailing list