1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
32
package com.sun.grid.cull;
39
public class Printer {
41
private final static String INDENT = " ";
42
private PrintWriter pw;
43
private StringBuffer indent = new StringBuffer();
44
private boolean needIndent;
46
public Printer( File file ) throws IOException {
50
public Printer( File file, boolean append ) throws IOException {
52
File parent = file.getParentFile();
53
if( !parent.exists() ) {
56
FileWriter fw = new FileWriter( file, append );
57
pw = new PrintWriter(fw);
61
pw = new PrintWriter( System.out );
64
public void printFile(File file) throws IOException {
66
FileReader fr = new FileReader(file);
67
BufferedReader br = new BufferedReader(fr);
70
while( (line=br.readLine()) != null) {
76
public void print( Object obj ) {
84
public void print( char c ) {
92
public void print(int i) {
100
public void print(boolean b) {
108
public void print(long l) {
116
public void println( Object obj ) {
125
public void println( char c ) {
134
public void println(int i) {
142
public void println() {
147
public void println(boolean b) {
155
public void println(long l) {
163
public void indent() {
164
indent.append( INDENT );
166
public void deindent() {
167
indent.setLength( indent.length() - INDENT.length() );
170
public void flush() {
174
public void close() {