23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.doclets.internal.toolkit.util; |
26 package com.sun.tools.doclets.internal.toolkit.util; |
27 |
27 |
|
28 import java.io.BufferedReader; |
|
29 import java.io.BufferedWriter; |
28 import java.io.FileNotFoundException; |
30 import java.io.FileNotFoundException; |
29 import java.io.IOException; |
31 import java.io.IOException; |
30 import java.io.InputStream; |
32 import java.io.InputStream; |
|
33 import java.io.InputStreamReader; |
31 import java.io.OutputStream; |
34 import java.io.OutputStream; |
|
35 import java.io.OutputStreamWriter; |
32 import java.io.UnsupportedEncodingException; |
36 import java.io.UnsupportedEncodingException; |
33 import java.io.Writer; |
37 import java.io.Writer; |
34 |
38 |
35 import javax.tools.JavaFileManager.Location; |
39 import javax.tools.JavaFileManager.Location; |
36 import javax.tools.StandardLocation; |
40 import javax.tools.StandardLocation; |
37 |
41 |
38 import com.sun.tools.doclets.internal.toolkit.Configuration; |
42 import com.sun.tools.doclets.internal.toolkit.Configuration; |
39 import java.io.BufferedReader; |
|
40 import java.io.BufferedWriter; |
|
41 import java.io.InputStreamReader; |
|
42 import java.io.OutputStreamWriter; |
|
43 |
43 |
44 /** |
44 /** |
45 * Abstraction for handling files, which may be specified directly |
45 * Abstraction for handling files, which may be specified directly |
46 * (e.g. via a path on the command line) or relative to a Location. |
46 * (e.g. via a path on the command line) or relative to a Location. |
47 * |
47 * |
113 public abstract InputStream openInputStream() throws IOException; |
113 public abstract InputStream openInputStream() throws IOException; |
114 |
114 |
115 /** |
115 /** |
116 * Open an output stream for the file. |
116 * Open an output stream for the file. |
117 * The file must have been created with a location of |
117 * The file must have been created with a location of |
118 * {@link StandardLocation#CLASS_OUTPUT} and a corresponding relative path. |
118 * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} |
|
119 * and a corresponding relative path. |
119 */ |
120 */ |
120 public abstract OutputStream openOutputStream() throws IOException, UnsupportedEncodingException; |
121 public abstract OutputStream openOutputStream() throws IOException, UnsupportedEncodingException; |
121 |
122 |
122 /** |
123 /** |
123 * Open an writer for the file, using the encoding (if any) given in the |
124 * Open an writer for the file, using the encoding (if any) given in the |
124 * doclet configuration. |
125 * doclet configuration. |
125 * The file must have been created with a location of |
126 * The file must have been created with a location of |
126 * {@link StandardLocation#CLASS_OUTPUT} and a corresponding relative path. |
127 * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path. |
127 */ |
128 */ |
128 public abstract Writer openWriter() throws IOException, UnsupportedEncodingException; |
129 public abstract Writer openWriter() throws IOException, UnsupportedEncodingException; |
129 |
130 |
130 /** |
131 /** |
131 * Copy the contents of another file directly to this file. |
132 * Copy the contents of another file directly to this file. |
249 */ |
250 */ |
250 public abstract DocFile resolve(String p); |
251 public abstract DocFile resolve(String p); |
251 |
252 |
252 /** |
253 /** |
253 * Resolve a relative file against the given output location. |
254 * Resolve a relative file against the given output location. |
254 * @param locn Currently, only SOURCE_OUTPUT is supported. |
255 * @param locn Currently, only |
255 */ |
256 * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} is supported. |
256 public abstract DocFile resolveAgainst(StandardLocation locn); |
257 */ |
|
258 public abstract DocFile resolveAgainst(Location locn); |
257 } |
259 } |