Class DocFile
java.lang.Object
gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.DocFile
- Direct Known Subclasses:
StandardDocFileFactory.StandardDocFile
Deprecated.
Abstraction for handling files, which may be specified directly
(e.g. via a path on the command line) or relative to a Location.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
- Since:
- 8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConfigurationDeprecated.protected final JavaFileManager.LocationDeprecated.The location for this file.protected final DocPathDeprecated.The path relative to the (output) location. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDocFile(Configuration configuration) Deprecated.Create a DocFile without a location or pathprotectedDocFile(Configuration configuration, JavaFileManager.Location location, DocPath path) Deprecated.Create a DocFile for a given location and relative path. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanRead()Deprecated.Return true if the file can be read.abstract booleancanWrite()Deprecated.Return true if the file can be written.voidDeprecated.Copy the contents of another file directly to this file.voidcopyResource(DocPath resource, boolean overwrite, boolean replaceNewLine) Deprecated.Copy the contents of a resource file to this file.static DocFilecreateFileForDirectory(Configuration configuration, String file) Deprecated.Create a DocFile for a directory.static DocFilecreateFileForInput(Configuration configuration, String file) Deprecated.Create a DocFile for a file that will be opened for reading.static DocFilecreateFileForOutput(Configuration configuration, DocPath path) Deprecated.Create a DocFile for a file that will be opened for writing.abstract booleanexists()Deprecated.Return true if the file exists.abstract StringgetName()Deprecated.Return the base name (last component) of the file name.abstract StringgetPath()Deprecated.Return the file system path for this file.abstract booleanDeprecated.Return true if file has an absolute path name.abstract booleanDeprecated.Return true if file identifies a directory.abstract booleanisFile()Deprecated.Return true if file identifies a file.abstract booleanisSameFile(DocFile other) Deprecated.Return true if this file is the same as another.list()Deprecated.If the file is a directory, list its contents.list(Configuration configuration, JavaFileManager.Location location, DocPath path) Deprecated.List the directories and files found in subdirectories along the elements of the given location.abstract booleanmkdirs()Deprecated.Create the file as a directory, including any parent directories.abstract InputStreamDeprecated.Open an input stream for the file.abstract OutputStreamDeprecated.Open an output stream for the file.abstract WriterDeprecated.Open an writer for the file, using the encoding (if any) given in the doclet configuration.abstract DocFileDeprecated.Derive a new file by resolving a relative path against this file.abstract DocFileDeprecated.Derive a new file by resolving a relative path against this file.abstract DocFileDeprecated.Resolve a relative file against the given output location.
-
Field Details
-
configuration
Deprecated. -
location
Deprecated.The location for this file. Maybe null if the file was created without a location or path. -
path
Deprecated.The path relative to the (output) location. Maybe null if the file was created without a location or path.
-
-
Constructor Details
-
DocFile
Deprecated.Create a DocFile without a location or path -
DocFile
Deprecated.Create a DocFile for a given location and relative path.
-
-
Method Details
-
createFileForDirectory
Deprecated.Create a DocFile for a directory. -
createFileForInput
Deprecated.Create a DocFile for a file that will be opened for reading. -
createFileForOutput
Deprecated.Create a DocFile for a file that will be opened for writing. -
list
public static Iterable<DocFile> list(Configuration configuration, JavaFileManager.Location location, DocPath path) Deprecated.List the directories and files found in subdirectories along the elements of the given location.- Parameters:
configuration- the doclet configurationlocation- currently, onlyStandardLocation.SOURCE_PATHis supported.path- the subdirectory of the directories of the location for which to list files
-
openInputStream
Deprecated.Open an input stream for the file.- Throws:
IOException
-
openOutputStream
Deprecated.Open an output stream for the file. The file must have been created with a location ofDocumentationTool.Location#DOCUMENTATION_OUTPUTand a corresponding relative path. -
openWriter
Deprecated.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 ofDocumentationTool.Location#DOCUMENTATION_OUTPUTand a corresponding relative path. -
copyFile
Deprecated.Copy the contents of another file directly to this file.- Throws:
IOException
-
copyResource
Deprecated.Copy the contents of a resource file to this file.- Parameters:
resource- the path of the resource, relative to the package of this classoverwrite- whether or not to overwrite the file if it already existsreplaceNewLine- if false, the file is copied as a binary file; if true, the file is written line by line, using the platform line separator
-
canRead
public abstract boolean canRead()Deprecated.Return true if the file can be read. -
canWrite
public abstract boolean canWrite()Deprecated.Return true if the file can be written. -
exists
public abstract boolean exists()Deprecated.Return true if the file exists. -
getName
Deprecated.Return the base name (last component) of the file name. -
getPath
Deprecated.Return the file system path for this file. -
isAbsolute
public abstract boolean isAbsolute()Deprecated.Return true if file has an absolute path name. -
isDirectory
public abstract boolean isDirectory()Deprecated.Return true if file identifies a directory. -
isFile
public abstract boolean isFile()Deprecated.Return true if file identifies a file. -
isSameFile
Deprecated.Return true if this file is the same as another. -
list
Deprecated.If the file is a directory, list its contents.- Throws:
IOException
-
mkdirs
public abstract boolean mkdirs()Deprecated.Create the file as a directory, including any parent directories. -
resolve
Deprecated.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
Deprecated.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
Deprecated.Resolve a relative file against the given output location.- Parameters:
locn- Currently, onlyDocumentationTool.Location#DOCUMENTATION_OUTPUTis supported.
-