bump product version to 4.1.6.2
[LibreOffice.git] / qadevOOo / runner / convwatch / LISTOutputter.java
blob23a83198b396c50b141ce23b0981894a98b830ec
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package convwatch;
21 import java.io.File;
22 import java.io.FileWriter;
24 public class LISTOutputter
26 FileWriter m_aOut;
27 String m_sFilename;
29 /**
30 * ls is the current line separator (carridge return)
32 String ls;
34 public static LISTOutputter create( String _sOutputPath, String _sFilename)
36 FileHelper.makeDirectories("", _sOutputPath);
37 LISTOutputter a = new LISTOutputter();
38 String fs = System.getProperty("file.separator");
39 String sFilename = _sOutputPath + fs + _sFilename;
41 try
43 File outputFile = new File(sFilename);
44 a.m_aOut = new FileWriter(outputFile.toString());
45 a.ls = System.getProperty("line.separator");
47 catch (java.io.IOException e)
49 e.printStackTrace();
50 GlobalLogWriter.get().println("ERROR: Can't create LIST Outputter");
51 return null;
53 a.m_sFilename = sFilename;
55 return a;
57 public String getFilename() {return m_sFilename;}
59 public void createHeader()
61 try
63 m_aOut.write("# This file is automatically created by a convwatch run" + ls);
64 m_aOut.write("# " + ls);
66 catch (java.io.IOException e)
71 public void writeValue(String _sValue)
73 try
75 m_aOut.write(_sValue + ls);
76 m_aOut.flush();
78 catch (java.io.IOException e)
83 public void close()
85 try
87 m_aOut.flush();
88 m_aOut.close();
90 catch (java.io.IOException e)