Class StandardDocFileFactory.StandardDocFile
- java.lang.Object
-
- gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.DocFile
-
- gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.StandardDocFileFactory.StandardDocFile
-
- Enclosing class:
- StandardDocFileFactory
class StandardDocFileFactory.StandardDocFile extends DocFile
-
-
Constructor Summary
Constructors Modifier Constructor Description privateStandardDocFile(java.nio.file.Path file)Create a StandardDocFile for a given file.privateStandardDocFile(javax.tools.JavaFileManager.Location location, DocPath path)Create a StandardDocFile for a given location and relative path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead()Return true if the file can be read.booleancanWrite()Return true if the file can be written.booleanexists()Return true if the file exists.private javax.tools.FileObjectgetFileObjectForOutput(DocPath path)private javax.tools.JavaFileObjectgetJavaFileObjectForInput(java.nio.file.Path file)java.lang.StringgetName()Return the base name (last component) of the file name.java.lang.StringgetPath()Return the file system path for this file.booleanisAbsolute()Return true is file has an absolute path name.booleanisDirectory()Return true is file identifies a directory.booleanisFile()Return true is file identifies a file.booleanisSameFile(DocFile other)Return true if this file is the same as another.java.lang.Iterable<DocFile>list()If the file is a directory, list its contents.booleanmkdirs()Create the file as a directory, including any parent directories.java.io.InputStreamopenInputStream()Open an input stream for the file.java.io.OutputStreamopenOutputStream()Open an output stream for the file.java.io.WriteropenWriter()Open an writer for the file, using the encoding (if any) given in the doclet configuration.DocFileresolve(DocPath p)Derive a new file by resolving a relative path against this file.DocFileresolve(java.lang.String p)Derive a new file by resolving a relative path against this file.DocFileresolveAgainst(javax.tools.JavaFileManager.Location locn)Resolve a relative file against the given output location.java.lang.StringtoString()Return a string to identify the contents of this object, for debugging purposes.-
Methods inherited from class gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.DocFile
copyFile, copyResource, createFileForDirectory, createFileForInput, createFileForOutput, list
-
-
-
-
Constructor Detail
-
StandardDocFile
private StandardDocFile(java.nio.file.Path file)
Create a StandardDocFile for a given file.
-
StandardDocFile
private StandardDocFile(javax.tools.JavaFileManager.Location location, DocPath path)Create a StandardDocFile for a given location and relative path.
-
-
Method Detail
-
openInputStream
public java.io.InputStream openInputStream() throws java.io.IOExceptionOpen an input stream for the file.- Specified by:
openInputStreamin classDocFile- Throws:
java.io.IOException
-
openOutputStream
public java.io.OutputStream openOutputStream() throws java.io.IOException, java.io.UnsupportedEncodingExceptionOpen an output stream for the file. The file must have been created with a location ofDocumentationTool.Location.DOCUMENTATION_OUTPUTand a corresponding relative path.- Specified by:
openOutputStreamin classDocFile- Throws:
java.io.IOExceptionjava.io.UnsupportedEncodingException
-
openWriter
public java.io.Writer openWriter() throws java.io.IOException, java.io.UnsupportedEncodingExceptionOpen 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.- Specified by:
openWriterin classDocFile- Throws:
java.io.IOExceptionjava.io.UnsupportedEncodingException
-
canRead
public boolean canRead()
Return true if the file can be read.
-
canWrite
public boolean canWrite()
Return true if the file can be written.
-
exists
public boolean exists()
Return true if the file exists.
-
getName
public java.lang.String getName()
Return the base name (last component) of the file name.
-
getPath
public java.lang.String getPath()
Return the file system path for this file.
-
isAbsolute
public boolean isAbsolute()
Return true is file has an absolute path name.- Specified by:
isAbsolutein classDocFile
-
isDirectory
public boolean isDirectory()
Return true is file identifies a directory.- Specified by:
isDirectoryin classDocFile
-
isFile
public boolean isFile()
Return true is file identifies a file.
-
isSameFile
public boolean isSameFile(DocFile other)
Return true if this file is the same as another.- Specified by:
isSameFilein classDocFile
-
list
public java.lang.Iterable<DocFile> list() throws java.io.IOException
If the file is a directory, list its contents.
-
mkdirs
public boolean mkdirs()
Create the file as a directory, including any parent directories.
-
resolve
public 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
public DocFile resolve(java.lang.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
public DocFile resolveAgainst(javax.tools.JavaFileManager.Location locn)
Resolve a relative file against the given output location.- Specified by:
resolveAgainstin classDocFile- Parameters:
locn- Currently, onlyDocumentationTool.Location.DOCUMENTATION_OUTPUTis supported.
-
toString
public java.lang.String toString()
Return a string to identify the contents of this object, for debugging purposes.- Overrides:
toStringin classjava.lang.Object
-
getJavaFileObjectForInput
private javax.tools.JavaFileObject getJavaFileObjectForInput(java.nio.file.Path file)
-
getFileObjectForOutput
private javax.tools.FileObject getFileObjectForOutput(DocPath path) throws java.io.IOException
- Throws:
java.io.IOException
-
-