Indent tigersripe.xml output.

Change-Id: I05c637dca70b961bba132988a11a4d87bc36d37f
diff --git a/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/AbstractTigerstripeProject.java b/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/AbstractTigerstripeProject.java
index 0a9cd29..890831c 100644
--- a/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/AbstractTigerstripeProject.java
+++ b/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/AbstractTigerstripeProject.java
@@ -11,7 +11,6 @@
 package org.eclipse.tigerstripe.workbench.internal.core.project;
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -186,6 +185,7 @@
             TransformerFactory tFactory = TransformerFactory.newInstance();
             Transformer transformer = tFactory.newTransformer();
             transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
 
             DOMSource source = new DOMSource(document);
 
@@ -195,6 +195,7 @@
         } catch (TransformerConfigurationException tce) {
             throw new TigerstripeException("Transformer Factory error" + tce.getMessage(), tce);
         } catch (TransformerException te) {
+            runtime.logErrorMessage("TransformerException detected", te);
             throw new TigerstripeException("Transformation error" + te.getMessage(), te);
         }
     }
@@ -429,47 +430,24 @@
                 return;
             }
 
-            FileReader reader = null;
-            try {
-                reader = new FileReader(theFile);
+            try (FileReader reader = new FileReader(theFile)) {
                 parse(reader);
                 notLoaded = false;
                 clearDirty();
-            } catch (FileNotFoundException e) {
-                throw new TigerstripeException("Tigerstripe descriptor not found (" + theFile.getAbsolutePath() + ").",
+            } catch (IOException e) {
+                throw new TigerstripeException("Failed to load Tigerstripe descriptor: " + theFile.getAbsolutePath(),
                         e);
-            } finally {
-                if (reader != null) {
-                    try {
-                        reader.close();
-                    } catch (IOException e) {
-                        // ignore
-                    }
-                }
             }
         }
     }
 
     public void doSave(IProgressMonitor monitor) throws TigerstripeException {
 
-        FileWriter writer = null;
-        try {
-            writer = new FileWriter(getFullPath());
+        try (FileWriter writer = new FileWriter(getFullPath())) {
             write(writer);
-            // Make sure we clear our dirty state
             clearDirty();
-        } catch (IOException e1) {
-            // TODO Auto-generated catch block
-            e1.printStackTrace();
-        } finally {
-            if (writer != null) {
-                try {
-                    writer.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
+        } catch (IOException e) {
+            throw new TigerstripeException("Failed to save project: " + getFullPath(), e);
         }
-
     }
 }
\ No newline at end of file
diff --git a/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/TigerstripeProject.java b/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/TigerstripeProject.java
index 29eae42..5c2fea3 100644
--- a/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/TigerstripeProject.java
+++ b/core/org.eclipse.tigerstripe.core/src/main/java/org/eclipse/tigerstripe/workbench/internal/core/project/TigerstripeProject.java
@@ -383,41 +383,6 @@
     }

 

     /**

-     * Write the current project to the passed writer

-     * 

-     * @param writer

-     * @throws TigerstripeException

-     */

-    @Override

-    public synchronized void write(Writer writer) throws TigerstripeException {

-

-        try {

-            Document document = buildDOM();

-            // Use a Transformer for output

-            TransformerFactory tFactory = TransformerFactory.newInstance();

-            Transformer transformer = tFactory.newTransformer();

-            transformer.setOutputProperty(OutputKeys.INDENT, "yes");

-

-            DOMSource source = new DOMSource(document);

-

-            StreamResult result = new StreamResult(writer);

-            transformer.transform(source, result);

-        } catch (TransformerConfigurationException tce) {

-            throw new TigerstripeException("Transformer Factory error" + tce.getMessage(), tce);

-        } catch (TransformerException te) {

-            runtime.logErrorMessage("TransformerException detected", te);

-            throw new TigerstripeException("Transformation error" + te.getMessage(), te);

-        }

-    }

-

-    @Override

-    public String asText() throws TigerstripeException {

-        StringWriter writer = new StringWriter();

-        write(writer);

-        return writer.toString();

-    }

-

-    /**

      * Builds the DOM for this Project

      * 

      */

@@ -449,7 +414,6 @@
 

     @Override

     public boolean requiresDescriptorUpgrade() {

-        // TODO Auto-generated method stub

         return false;

     }