buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/filters/PrettyPrintXmlFilter.java
changeset 628 7c4a911dc066
parent 587 85df38eb4012
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 package com.nokia.helium.core.ant.filters;
    18 package com.nokia.helium.core.ant.filters;
    19 
    19 
       
    20 import java.io.IOException;
    20 import java.io.StringWriter;
    21 import java.io.StringWriter;
    21 
    22 
    22 import org.apache.tools.ant.BuildException;
    23 import org.apache.tools.ant.BuildException;
    23 import org.apache.tools.ant.filters.TokenFilter.Filter;
    24 import org.apache.tools.ant.filters.TokenFilter.Filter;
    24 import org.dom4j.Document;
    25 import org.dom4j.Document;
    25 import org.dom4j.DocumentHelper;
    26 import org.dom4j.DocumentHelper;
    26 import org.dom4j.io.OutputFormat;
    27 import org.dom4j.io.OutputFormat;
    27 import org.dom4j.io.XMLWriter;
    28 import org.dom4j.io.XMLWriter;
    28 import java.io.IOException;
       
    29 
    29 
    30 /**
    30 /**
    31  * Prints xml file in pretty format.
    31  * Prints xml file in pretty format.
    32  * 
    32  * 
    33  */
    33  */
    57                 throw new BuildException(exc.getMessage(), exc);
    57                 throw new BuildException(exc.getMessage(), exc);
    58             } catch (IOException exc) {
    58             } catch (IOException exc) {
    59                 throw new BuildException(exc.getMessage(), exc);
    59                 throw new BuildException(exc.getMessage(), exc);
    60             } finally {
    60             } finally {
    61                 try {
    61                 try {
    62                     if (writer != null)
    62                     if (writer != null) {
    63                         writer.close();
    63                         writer.close();
       
    64                     }
    64                 } catch (IOException exc) {
    65                 } catch (IOException exc) {
    65                     throw new BuildException(exc.getMessage(), exc);
    66                     throw new BuildException(exc.getMessage(), exc);
    66                 }
    67                 }
    67             }
    68             }
    68         }
    69         }