1 |
/* FileWriter.java -- Convenience class for writing to files. |
/* FileWriter.java -- Convenience class for writing to files. |
2 |
Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
49 |
* <code>OutputStreamWriter</code> to write to it. |
* <code>OutputStreamWriter</code> to write to it. |
50 |
* |
* |
51 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn (arenn@urbanophile.com) |
52 |
* @author Tom Tromey <tromey@cygnus.com> |
* @author Tom Tromey (tromey@cygnus.com) |
53 |
*/ |
*/ |
54 |
public class FileWriter extends OutputStreamWriter |
public class FileWriter extends OutputStreamWriter |
55 |
{ |
{ |
|
|
|
|
/* |
|
|
* Constructors |
|
|
*/ |
|
|
|
|
56 |
/** |
/** |
57 |
* This method initializes a new <code>FileWriter</code> object to write |
* This method initializes a new <code>FileWriter</code> object to write |
58 |
* to the specified <code>File</code> object. |
* to the specified <code>File</code> object. |
59 |
* |
* |
60 |
* @param file The <code>File</code> object to write to. |
* @param file The <code>File</code> object to write to. |
61 |
* |
* |
62 |
* @param SecurityException If writing to this file is forbidden by the |
* @throws SecurityException If writing to this file is forbidden by the |
63 |
* <code>SecurityManager</code>. |
* <code>SecurityManager</code>. |
64 |
* @param IOException If any other error occurs |
* @throws IOException If any other error occurs |
65 |
*/ |
*/ |
66 |
public FileWriter(File file) throws SecurityException, IOException |
public FileWriter(File file) throws SecurityException, IOException |
67 |
{ |
{ |
68 |
super(new FileOutputStream(file)); |
super(new FileOutputStream(file)); |
69 |
} |
} |
70 |
|
|
71 |
/** |
/** |
72 |
* This method initializes a new <code>FileWriter</code> object to write |
* This method initializes a new <code>FileWriter</code> object to write |
73 |
* to the specified <code>File</code> object. |
* to the specified <code>File</code> object. |
74 |
* |
* |
75 |
* @param file The <code>File</code> object to write to. |
* @param file The <code>File</code> object to write to. |
76 |
* @param append <code>true</code> to start adding data at the end of the |
* @param append <code>true</code> to start adding data at the end of the |
77 |
* file, <code>false</code> otherwise. |
* file, <code>false</code> otherwise. |
78 |
* |
* |
79 |
* @param SecurityException If writing to this file is forbidden by the |
* @throws SecurityException If writing to this file is forbidden by the |
80 |
* <code>SecurityManager</code>. |
* <code>SecurityManager</code>. |
81 |
* @param IOException If any other error occurs |
* @throws IOException If any other error occurs |
82 |
*/ |
*/ |
83 |
public FileWriter(File file, boolean append) throws IOException |
public FileWriter(File file, boolean append) throws IOException |
84 |
{ |
{ |
85 |
super(new FileOutputStream(file, append)); |
super(new FileOutputStream(file, append)); |
86 |
} |
} |
87 |
|
|
88 |
/** |
/** |
89 |
* This method initializes a new <code>FileWriter</code> object to write |
* This method initializes a new <code>FileWriter</code> object to write |
90 |
* to the specified <code>FileDescriptor</code> object. |
* to the specified <code>FileDescriptor</code> object. |
91 |
* |
* |
92 |
* @param fd The <code>FileDescriptor</code> object to write to |
* @param fd The <code>FileDescriptor</code> object to write to |
93 |
* |
* |
94 |
* @param SecurityException If writing to this file is forbidden by the |
* @throws SecurityException If writing to this file is forbidden by the |
95 |
* <code>SecurityManager</code>. |
* <code>SecurityManager</code>. |
96 |
*/ |
*/ |
97 |
public FileWriter(FileDescriptor fd) throws SecurityException |
public FileWriter(FileDescriptor fd) throws SecurityException |
98 |
{ |
{ |
99 |
super(new FileOutputStream(fd)); |
super(new FileOutputStream(fd)); |
100 |
} |
} |
101 |
|
|
102 |
/** |
/** |
103 |
* This method intializes a new <code>FileWriter</code> object to |
* This method intializes a new <code>FileWriter</code> object to |
104 |
* write to the |
* write to the |
105 |
* specified named file. |
* specified named file. |
106 |
* |
* |
107 |
* @param name The name of the file to write to |
* @param name The name of the file to write to |
108 |
* |
* |
109 |
* @param SecurityException If writing to this file is forbidden by the |
* @throws SecurityException If writing to this file is forbidden by the |
110 |
* <code>SecurityManager</code>. |
* <code>SecurityManager</code>. |
111 |
* @param IOException If any other error occurs |
* @throws IOException If any other error occurs |
112 |
*/ |
*/ |
113 |
public FileWriter(String name) throws IOException |
public FileWriter(String name) throws IOException |
114 |
{ |
{ |
115 |
super(new FileOutputStream(name)); |
super(new FileOutputStream(name)); |
116 |
} |
} |
117 |
|
|
118 |
/** |
/** |
119 |
* This method intializes a new <code>FileWriter</code> object to |
* This method intializes a new <code>FileWriter</code> object to |
120 |
* write to the |
* write to the |
121 |
* specified named file. This form of the constructor allows the caller |
* specified named file. This form of the constructor allows the caller |
122 |
* to determin whether data should be written starting at the beginning or |
* to determin whether data should be written starting at the beginning or |
123 |
* the end of the file. |
* the end of the file. |
124 |
* |
* |
125 |
* @param name The name of the file to write to |
* @param name The name of the file to write to |
126 |
* @param append <code>true</code> to start adding data at the end of the |
* @param append <code>true</code> to start adding data at the end of the |
127 |
* file, <code>false</code> otherwise. |
* file, <code>false</code> otherwise. |
128 |
* |
* |
129 |
* @param SecurityException If writing to this file is forbidden by the |
* @throws SecurityException If writing to this file is forbidden by the |
130 |
* <code>SecurityManager</code>. |
* <code>SecurityManager</code>. |
131 |
* @param IOException If any other error occurs |
* @throws IOException If any other error occurs |
132 |
*/ |
*/ |
133 |
public FileWriter(String name, boolean append) throws IOException |
public FileWriter(String name, boolean append) throws IOException |
134 |
{ |
{ |
135 |
super(new FileOutputStream(name, append)); |
super(new FileOutputStream(name, append)); |
136 |
} |
} |
137 |
|
} |
|
} // class FileWriter |
|
|
|
|