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

michi at wyona.com michi at wyona.com
Thu Aug 7 10:28:33 CEST 2008


Author: michi
Date: 2008-08-07 10:28:32 +0200 (Thu, 07 Aug 2008)
New Revision: 37843

Modified:
   public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarEvent.java
   public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarResource.java
Log:
debugging improved and streams closed explicitely

Modified: public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarEvent.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarEvent.java	2008-08-07 08:15:55 UTC (rev 37842)
+++ public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarEvent.java	2008-08-07 08:28:32 UTC (rev 37843)
@@ -144,8 +144,16 @@
             setStart(icsLine.substring(icsLine.indexOf("TZID=") + 5));
         } else if (icsLine.startsWith("DTEND;")) {
             setEnd(icsLine.substring(icsLine.indexOf("TZID=") + 5));
+        } else if (icsLine.startsWith("DESCRIPTION:")) {
+            log.warn("DESCRIPTION tag not implemented yet: " + icsLine.split(":")[1]);
+        } else if (icsLine.startsWith("ATTENDEE:")) {
+            log.warn("ATTENDEE tag not implemented yet: " + icsLine.split(":")[1]);
+        } else if (icsLine.startsWith("PRIORITY:")) {
+            log.warn("PRIORITY tag not implemented yet: " + icsLine.split(":")[1]);
+        } else if (icsLine.startsWith("STATUS:")) {
+            log.warn("STATUS tag not implemented yet: " + icsLine.split(":")[1]);
         } else {
-            log.warn("Not implemented yet: " + icsLine);
+            log.warn("Not implemented yet (probably some text with line-breaks!): " + icsLine);
         }
     }
 }

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	2008-08-07 08:15:55 UTC (rev 37842)
+++ public/yanel/trunk/src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/CalendarResource.java	2008-08-07 08:28:32 UTC (rev 37843)
@@ -222,12 +222,12 @@
         //java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(in));
         String line;
         CalendarEvent event = null;
-        log.debug("Parse ICS and write events as XML into repository ...");
+        log.error("DEBUG: Parse ICS and write events as XML into repository ...");
         while ((line = br.readLine()) != null) {
             if (line.startsWith("BEGIN:VEVENT")) {
                 event = new CalendarEvent();
             } else if (line.startsWith("END:VEVENT")) {
-                log.error("DEBUG: Write event " + event.getUID() + ", " + event.toXML());
+                //log.error("DEBUG: Write event " + event.getUID() + ", " + event.toXML());
                 Writer out = getRealm().getRepository().getWriter(new org.wyona.yarep.core.Path(getResourceConfigProperty("events-path") + "/" + event.getUID() + ".xml"));
                 out.write(event.toXML());
                 out.close();
@@ -236,16 +236,18 @@
                 if (event != null) {
                     event.setProperty(line);
                 } else {
-                    log.warn("Not implemented yet: " + line);
+                    //log.warn("Not implemented yet: " + line);
                 }
             }
         }
+        br.close();
     }
 
     /**
      * Save/Write the actual ICS
      */
     private InputStream writeICS(InputStream in) throws Exception {
+        log.error("DEBUG: Write ICS as a whole to the repository: " + getPath());
         org.wyona.yarep.core.Path path = new org.wyona.yarep.core.Path(getPath());
         OutputStream out = getRealm().getRepository().getOutputStream(path);
         byte[] buf = new byte[8192];
@@ -253,6 +255,8 @@
         while ((bytesR = in.read(buf)) != -1) {
             out.write(buf, 0, bytesR);
         }
+        out.close();
+        in.close();
         return getRealm().getRepository().getInputStream(path);
     }
 



More information about the Yanel-commits mailing list