| Modifier and Type | Field and Description |
|---|---|
| protected final JavaFileManager. | location
The location for this file. |
| protected final DocPath | path
The path relative to the (output) location. |
| public static final String | PLATFORM_LINE_SEPARATOR
The line separator for the current platform. |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | DocFile(JavaFileManager.
Create a DocFile for a given location and relative path. |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | |
| public abstract boolean | |
| public void | |
| public void | copyResource(DocPath
the path of the resource resource, URL the URL of the resource url, boolean if false, the file is copied as a binary file;
if true, the file is written line by line, using the platform line
separator replaceNewLine)Copy the contents of a resource file to this file. |
| public void | copyResource(DocPath
the path of the resource resource, URL the URL of the resource url, Resources if not resources)null, substitute occurrences of ##REPLACE:key##Copy the contents of a resource file to this file. |
| public void | copyResource(DocPath
the path of the resource resource, URL the URL of the resource url, UnaryOperator<String> the transforming function that is called for each line; may return
lineTransformer)null to remove a line.Copy the contents of a resource file to this file while transforming and filtering its lines. |
| private void | copyResource(DocPath resource, URL url, boolean replaceNewLine, UnaryOperator<String> lineTransformer)
|
| public static DocFile | createFileForDirectory(BaseConfiguration configuration, String file)
Create a DocFile for a directory. |
| public static DocFile | createFileForInput(BaseConfiguration configuration, String file)
Create a DocFile for a file that will be opened for reading. |
| public static DocFile | createFileForInput(BaseConfiguration configuration, Path file)
Create a DocFile for a file that will be opened for reading. |
| public static DocFile | createFileForOutput(BaseConfiguration configuration, DocPath path)
Create a DocFile for a file that will be opened for writing. |
| public abstract boolean | |
| public abstract FileObject | |
| public abstract String | |
| public abstract String | |
| public abstract boolean | |
| public abstract boolean | |
| public abstract boolean | |
| public abstract boolean | |
| public static Iterable | list(BaseConfiguration
the doclet configuration configuration, JavaFileManager.currently, only location,StandardLocation#SOURCE_PATH is supported.the subdirectory of the directories of the location for which to
list files path)List the directories and files found in subdirectories along the elements of the given location. |
| public abstract Iterable | |
| private String | |
| public abstract boolean | |
| public abstract InputStream | |
| public abstract OutputStream | |
| public abstract Writer | Returns: an open output stream for the fileOpen an writer for the file, using the encoding (if any) given in the doclet configuration. |
| private static int | Returns: the number of bytes read, or -1 if at end of filethe file for the stream inFile, InputStream the stream input, byte[] the buffer buf)Reads from an input stream opened from a given file into a given buffer. |
| private static int | Returns: the number of bytes read, or -1 if at end of filethe resource for the stream docPath, InputStream the stream in, byte[] the buffer buf)Reads from an input stream opened from a given resource into a given buffer. |
| private static String | Returns: the line of text, ornull if at end of streamthe resource for the stream docPath, BufferedReader the stream in)Reads a line of characters from an input stream opened from a given resource. |
| public abstract DocFile | |
| public abstract DocFile | |
| public abstract DocFile | resolveAgainst(JavaFileManager.
Currently, only
locnDocumentationTool. is supported.Resolve a relative file against the given output location. |
| private static void | write(DocFile
the file for the stream outFile, OutputStream the stream out, byte[] the buffer buf, int len)Writes to an output stream for a given file from a given buffer. |
| private static void |
| location | back to summary |
|---|---|
| protected final JavaFileManager. The location for this file. Maybe null if the file was created without a location or path. | |
| path | back to summary |
|---|---|
| protected final DocPath path The path relative to the (output) location. Maybe null if the file was created without a location or path. | |
| PLATFORM_LINE_SEPARATOR | back to summary |
|---|---|
| public static final String PLATFORM_LINE_SEPARATOR The line separator for the current platform. Use this when writing to external files. | |
| replacePtn | back to summary |
|---|---|
| private static final Pattern replacePtn | |
| DocFile | back to summary |
|---|---|
| protected DocFile() Create a DocFile without a location or path | |
| DocFile | back to summary |
|---|---|
| protected DocFile(JavaFileManager. Create a DocFile for a given location and relative path. | |
| canRead | back to summary |
|---|---|
| public abstract boolean canRead() Return true if the file can be read. | |
| canWrite | back to summary |
|---|---|
| public abstract boolean canWrite() Return true if the file can be written. | |
| copyFile | back to summary |
|---|---|
| public void copyFile(DocFile fromFile) throws DocFileIOException Copy the contents of another file directly to this file.
| |
| copyResource | back to summary |
|---|---|
| public void copyResource(DocPath resource, URL url, boolean replaceNewLine) throws DocFileIOException, ResourceIOException Copy the contents of a resource file to this file.
| |
| copyResource | back to summary |
|---|---|
| public void copyResource(DocPath resource, URL url, Resources resources) throws DocFileIOException, ResourceIOException Copy the contents of a resource file to this file.
| |
| copyResource | back to summary |
|---|---|
| public void copyResource(DocPath resource, URL url, UnaryOperator<String> lineTransformer) throws DocFileIOException, ResourceIOException Copy the contents of a resource file to this file while transforming and filtering its lines.
| |
| copyResource | back to summary |
|---|---|
| private void copyResource(DocPath resource, URL url, boolean replaceNewLine, UnaryOperator<String> lineTransformer) throws ResourceIOException, DocFileIOException | |
| createFileForDirectory | back to summary |
|---|---|
| public static DocFile createFileForDirectory(BaseConfiguration configuration, String file) Create a DocFile for a directory. | |
| createFileForInput | back to summary |
|---|---|
| public static DocFile createFileForInput(BaseConfiguration configuration, String file) Create a DocFile for a file that will be opened for reading. | |
| createFileForInput | back to summary |
|---|---|
| public static DocFile createFileForInput(BaseConfiguration configuration, Path file) Create a DocFile for a file that will be opened for reading. | |
| createFileForOutput | back to summary |
|---|---|
| public static DocFile createFileForOutput(BaseConfiguration configuration, DocPath path) Create a DocFile for a file that will be opened for writing. | |
| exists | back to summary |
|---|---|
| public abstract boolean exists() Return true if the file exists. | |
| getFileObject | back to summary |
|---|---|
| public abstract FileObject getFileObject() Returns a file object for the file.
| |
| getName | back to summary |
|---|---|
| public abstract String getName() Return the base name (last component) of the file name. | |
| getPath | back to summary |
|---|---|
| public abstract String getPath() Return the file system path for this file. | |
| isAbsolute | back to summary |
|---|---|
| public abstract boolean isAbsolute() Return true if file has an absolute path name. | |
| isDirectory | back to summary |
|---|---|
| public abstract boolean isDirectory() Return true if file identifies a directory. | |
| isFile | back to summary |
|---|---|
| public abstract boolean isFile() Return true if file identifies a file. | |
| isSameFile | back to summary |
|---|---|
| public abstract boolean isSameFile(DocFile other) Return true if this file is the same as another. | |
| list | back to summary |
|---|---|
| public static Iterable List the directories and files found in subdirectories along the elements of the given location.
| |
| list | back to summary |
|---|---|
| public abstract Iterable If the file is a directory, list its contents.
| |
| localize | back to summary |
|---|---|
| private String localize(String line, Resources resources) | |
| mkdirs | back to summary |
|---|---|
| public abstract boolean mkdirs() Create the file as a directory, including any parent directories. | |
| openInputStream | back to summary |
|---|---|
| public abstract InputStream openInputStream() throws DocFileIOException Open an input stream for the file.
| |
| openOutputStream | back to summary |
|---|---|
| public abstract OutputStream openOutputStream() throws DocFileIOException, UnsupportedEncodingException Open an output stream for the file.
The file must have been created with a location of
| |
| openWriter | back to summary |
|---|---|
| public abstract Writer openWriter() throws DocFileIOException, UnsupportedEncodingException Open an writer for the file, using the encoding (if any) given in the
doclet configuration.
The file must have been created with a location of
| |
| read | back to summary |
|---|---|
| private static int read(DocFile inFile, InputStream input, byte[] buf) throws DocFileIOException Reads from an input stream opened from a given file into a given buffer.
If an
| |
| readResource | back to summary |
|---|---|
| private static int readResource(DocPath docPath, InputStream in, byte[] buf) throws ResourceIOException Reads from an input stream opened from a given resource into a given buffer.
If an
| |
| readResourceLine | back to summary |
|---|---|
| private static String readResourceLine(DocPath docPath, BufferedReader in) throws ResourceIOException Reads a line of characters from an input stream opened from a given resource.
If an
| |
| resolve | back to summary |
|---|---|
| public abstract DocFile resolve(DocPath p) Derive a new file by resolving a relative path against this file. The new file will inherit the configuration and location of this file If this file has a path set, the new file will have a corresponding new path. | |
| resolve | back to summary |
|---|---|
| public abstract DocFile resolve(String p) Derive a new file by resolving a relative path against this file. The new file will inherit the configuration and location of this file If this file has a path set, the new file will have a corresponding new path. | |
| resolveAgainst | back to summary |
|---|---|
| public abstract DocFile resolveAgainst(JavaFileManager. Resolve a relative file against the given output location.
| |
| write | back to summary |
|---|---|
| private static void write(DocFile outFile, OutputStream out, byte[] buf, int len) throws DocFileIOException Writes to an output stream for a given file from a given buffer.
If an
| |
| write | back to summary |
|---|---|
| private static void write(DocFile outFile, Writer out, String text) throws DocFileIOException Writes text to an output stream for a given file from a given buffer.
If an
| |