Author: kelvingoodson
Date: Tue Feb  2 17:48:53 2010
New Revision: 905731

URL: http://svn.apache.org/viewvc?rev=905731&view=rev
Log:
write plan after jira data refresh

Modified:
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java

Modified: tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java?rev=905731&r1=905730&r2=905731&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java 
(original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java Tue 
Feb  2 17:48:53 2010
@@ -50,7 +50,7 @@
        static String rssPrefix = 
"http://issues.apache.org/jira/si/jira.issueviews:issue-xml/";;
        @Property
        public String planFile = "src/main/resources/jiraSideBand.xml";
-
+       
        @Init
        public void init() {
        }
@@ -60,6 +60,7 @@
                try {
                        p = readPlan();
                        augmentPlan(p);
+                       writePlan(p);
                } catch (Exception e) {
                        e.printStackTrace();
                }
@@ -236,10 +237,15 @@
                        Unmarshaller m = jaxbContext.createUnmarshaller();
                        
                        File inputFile = new File(planFile).getAbsoluteFile();
+                       if(!inputFile.exists()){ // start afresh
+                               Plan newPlan = new Plan();
+                               writePlan(newPlan);
+                               inputFile = new 
File(planFile).getAbsoluteFile();
+                       }
 
                        p = (Plan)m.unmarshal(inputFile);
                } catch(Exception e) {
-                       // FIXME
+                       throw new IllegalStateException("Failed to read plan 
file",e);
                }
                return p;
        }


Reply via email to