1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: LISTOutputter.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 import java
.io
.FileWriter
;
36 public class LISTOutputter
42 * ls is the current line separator (carridge return)
46 public static LISTOutputter
create( String _sOutputPath
, String _sFilename
)
48 FileHelper
.makeDirectories("", _sOutputPath
);
49 LISTOutputter a
= new LISTOutputter();
50 String fs
= System
.getProperty("file.separator");
51 String sFilename
= _sOutputPath
+ fs
+ _sFilename
;
55 File outputFile
= new File(sFilename
);
56 a
.m_aOut
= new FileWriter(outputFile
.toString());
57 a
.ls
= System
.getProperty("line.separator");
59 catch (java
.io
.IOException e
)
62 GlobalLogWriter
.get().println("ERROR: Can't create LIST Outputter");
65 a
.m_sFilename
= sFilename
;
69 public String
getFilename() {return m_sFilename
;}
71 public void createHeader()
75 m_aOut
.write("# This file is automatically created by a convwatch run" + ls
);
76 m_aOut
.write("# " + ls
);
78 catch (java
.io
.IOException e
)
83 public void writeValue(String _sValue
)
87 m_aOut
.write(_sValue
+ ls
);
90 catch (java
.io
.IOException e
)
102 catch (java
.io
.IOException e
)