Class StandardDocFileFactory.StandardDocFile

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.Path file  
      • Fields inherited from class gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.DocFile

        location, path
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StandardDocFile​(java.nio.file.Path file)
      Create a StandardDocFile for a given file.
      private StandardDocFile​(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
      boolean canRead()
      Return true if the file can be read.
      boolean canWrite()
      Return true if the file can be written.
      boolean exists()
      Return true if the file exists.
      private javax.tools.FileObject getFileObjectForOutput​(DocPath path)  
      private javax.tools.JavaFileObject getJavaFileObjectForInput​(java.nio.file.Path file)  
      java.lang.String getName()
      Return the base name (last component) of the file name.
      java.lang.String getPath()
      Return the file system path for this file.
      boolean isAbsolute()
      Return true is file has an absolute path name.
      boolean isDirectory()
      Return true is file identifies a directory.
      boolean isFile()
      Return true is file identifies a file.
      boolean isSameFile​(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.
      boolean mkdirs()
      Create the file as a directory, including any parent directories.
      java.io.InputStream openInputStream()
      Open an input stream for the file.
      java.io.OutputStream openOutputStream()
      Open an output stream for the file.
      java.io.Writer openWriter()
      Open an writer for the file, using the encoding (if any) given in the doclet configuration.
      DocFile resolve​(DocPath p)
      Derive a new file by resolving a relative path against this file.
      DocFile resolve​(java.lang.String p)
      Derive a new file by resolving a relative path against this file.
      DocFile resolveAgainst​(javax.tools.JavaFileManager.Location locn)
      Resolve a relative file against the given output location.
      java.lang.String toString()
      Return a string to identify the contents of this object, for debugging purposes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • file

        private java.nio.file.Path file
    • 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.IOException
        Open an input stream for the file.
        Specified by:
        openInputStream in class DocFile
        Throws:
        java.io.IOException
      • openOutputStream

        public java.io.OutputStream openOutputStream()
                                              throws java.io.IOException,
                                                     java.io.UnsupportedEncodingException
        Open an output stream for the file. The file must have been created with a location of DocumentationTool.Location.DOCUMENTATION_OUTPUT and a corresponding relative path.
        Specified by:
        openOutputStream in class DocFile
        Throws:
        java.io.IOException
        java.io.UnsupportedEncodingException
      • openWriter

        public java.io.Writer openWriter()
                                  throws java.io.IOException,
                                         java.io.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 DocumentationTool.Location.DOCUMENTATION_OUTPUT and a corresponding relative path.
        Specified by:
        openWriter in class DocFile
        Throws:
        java.io.IOException
        java.io.UnsupportedEncodingException
      • canRead

        public boolean canRead()
        Return true if the file can be read.
        Specified by:
        canRead in class DocFile
      • canWrite

        public boolean canWrite()
        Return true if the file can be written.
        Specified by:
        canWrite in class DocFile
      • exists

        public boolean exists()
        Return true if the file exists.
        Specified by:
        exists in class DocFile
      • getName

        public java.lang.String getName()
        Return the base name (last component) of the file name.
        Specified by:
        getName in class DocFile
      • getPath

        public java.lang.String getPath()
        Return the file system path for this file.
        Specified by:
        getPath in class DocFile
      • isAbsolute

        public boolean isAbsolute()
        Return true is file has an absolute path name.
        Specified by:
        isAbsolute in class DocFile
      • isDirectory

        public boolean isDirectory()
        Return true is file identifies a directory.
        Specified by:
        isDirectory in class DocFile
      • isFile

        public boolean isFile()
        Return true is file identifies a file.
        Specified by:
        isFile in class DocFile
      • isSameFile

        public boolean isSameFile​(DocFile other)
        Return true if this file is the same as another.
        Specified by:
        isSameFile in class DocFile
      • list

        public java.lang.Iterable<DocFile> list()
                                         throws java.io.IOException
        If the file is a directory, list its contents.
        Specified by:
        list in class DocFile
        Throws:
        java.io.IOException
      • mkdirs

        public boolean mkdirs()
        Create the file as a directory, including any parent directories.
        Specified by:
        mkdirs in class DocFile
      • 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.
        Specified by:
        resolve in class DocFile
      • 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.
        Specified by:
        resolve in class DocFile
      • resolveAgainst

        public DocFile resolveAgainst​(javax.tools.JavaFileManager.Location locn)
        Resolve a relative file against the given output location.
        Specified by:
        resolveAgainst in class DocFile
        Parameters:
        locn - Currently, only DocumentationTool.Location.DOCUMENTATION_OUTPUT is supported.
      • toString

        public java.lang.String toString()
        Return a string to identify the contents of this object, for debugging purposes.
        Overrides:
        toString in class java.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