Class DocFile

  • Direct Known Subclasses:
    StandardDocFileFactory.StandardDocFile

    @Deprecated
    public abstract class DocFile
    extends java.lang.Object
    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

      Fields 
      Modifier and Type Field Description
      private Configuration configuration
      Deprecated.
       
      protected javax.tools.JavaFileManager.Location location
      Deprecated.
      The location for this file.
      protected DocPath path
      Deprecated.
      The path relative to the (output) location.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DocFile​(Configuration configuration)
      Deprecated.
      Create a DocFile without a location or path
      protected DocFile​(Configuration configuration, javax.tools.JavaFileManager.Location location, DocPath path)
      Deprecated.
      Create a DocFile for a given location and relative path.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      abstract boolean canRead()
      Deprecated.
      Return true if the file can be read.
      abstract boolean canWrite()
      Deprecated.
      Return true if the file can be written.
      void copyFile​(DocFile fromFile)
      Deprecated.
      Copy the contents of another file directly to this file.
      void copyResource​(DocPath resource, boolean overwrite, boolean replaceNewLine)
      Deprecated.
      Copy the contents of a resource file to this file.
      static DocFile createFileForDirectory​(Configuration configuration, java.lang.String file)
      Deprecated.
      Create a DocFile for a directory.
      static DocFile createFileForInput​(Configuration configuration, java.lang.String file)
      Deprecated.
      Create a DocFile for a file that will be opened for reading.
      static DocFile createFileForOutput​(Configuration configuration, DocPath path)
      Deprecated.
      Create a DocFile for a file that will be opened for writing.
      abstract boolean exists()
      Deprecated.
      Return true if the file exists.
      abstract java.lang.String getName()
      Deprecated.
      Return the base name (last component) of the file name.
      abstract java.lang.String getPath()
      Deprecated.
      Return the file system path for this file.
      abstract boolean isAbsolute()
      Deprecated.
      Return true if file has an absolute path name.
      abstract boolean isDirectory()
      Deprecated.
      Return true if file identifies a directory.
      abstract boolean isFile()
      Deprecated.
      Return true if file identifies a file.
      abstract boolean isSameFile​(DocFile other)
      Deprecated.
      Return true if this file is the same as another.
      abstract java.lang.Iterable<DocFile> list()
      Deprecated.
      If the file is a directory, list its contents.
      static java.lang.Iterable<DocFile> list​(Configuration configuration, javax.tools.JavaFileManager.Location location, DocPath path)
      Deprecated.
      List the directories and files found in subdirectories along the elements of the given location.
      abstract boolean mkdirs()
      Deprecated.
      Create the file as a directory, including any parent directories.
      abstract java.io.InputStream openInputStream()
      Deprecated.
      Open an input stream for the file.
      abstract java.io.OutputStream openOutputStream()
      Deprecated.
      Open an output stream for the file.
      abstract java.io.Writer openWriter()
      Deprecated.
      Open an writer for the file, using the encoding (if any) given in the doclet configuration.
      abstract DocFile resolve​(DocPath p)
      Deprecated.
      Derive a new file by resolving a relative path against this file.
      abstract DocFile resolve​(java.lang.String p)
      Deprecated.
      Derive a new file by resolving a relative path against this file.
      abstract DocFile resolveAgainst​(javax.tools.JavaFileManager.Location locn)
      Deprecated.
      Resolve a relative file against the given output location.
      • Methods inherited from class java.lang.Object

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

      • configuration

        private final Configuration configuration
        Deprecated.
      • location

        protected final javax.tools.JavaFileManager.Location location
        Deprecated.
        The location for this file. Maybe null if the file was created without a location or path.
      • path

        protected final DocPath path
        Deprecated.
        The path relative to the (output) location. Maybe null if the file was created without a location or path.
    • Constructor Detail

      • DocFile

        protected DocFile​(Configuration configuration)
        Deprecated.
        Create a DocFile without a location or path
      • DocFile

        protected DocFile​(Configuration configuration,
                          javax.tools.JavaFileManager.Location location,
                          DocPath path)
        Deprecated.
        Create a DocFile for a given location and relative path.
    • Method Detail

      • createFileForDirectory

        public static DocFile createFileForDirectory​(Configuration configuration,
                                                     java.lang.String file)
        Deprecated.
        Create a DocFile for a directory.
      • createFileForInput

        public static DocFile createFileForInput​(Configuration configuration,
                                                 java.lang.String file)
        Deprecated.
        Create a DocFile for a file that will be opened for reading.
      • createFileForOutput

        public static DocFile createFileForOutput​(Configuration configuration,
                                                  DocPath path)
        Deprecated.
        Create a DocFile for a file that will be opened for writing.
      • list

        public static java.lang.Iterable<DocFile> list​(Configuration configuration,
                                                       javax.tools.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 configuration
        location - currently, only StandardLocation.SOURCE_PATH is supported.
        path - the subdirectory of the directories of the location for which to list files
      • openInputStream

        public abstract java.io.InputStream openInputStream()
                                                     throws java.io.IOException
        Deprecated.
        Open an input stream for the file.
        Throws:
        java.io.IOException
      • openOutputStream

        public abstract java.io.OutputStream openOutputStream()
                                                       throws java.io.IOException,
                                                              java.io.UnsupportedEncodingException
        Deprecated.
        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.
        Throws:
        java.io.IOException
        java.io.UnsupportedEncodingException
      • openWriter

        public abstract java.io.Writer openWriter()
                                           throws java.io.IOException,
                                                  java.io.UnsupportedEncodingException
        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 of DocumentationTool.Location#DOCUMENTATION_OUTPUT and a corresponding relative path.
        Throws:
        java.io.IOException
        java.io.UnsupportedEncodingException
      • copyFile

        public void copyFile​(DocFile fromFile)
                      throws java.io.IOException
        Deprecated.
        Copy the contents of another file directly to this file.
        Throws:
        java.io.IOException
      • copyResource

        public void copyResource​(DocPath resource,
                                 boolean overwrite,
                                 boolean replaceNewLine)
        Deprecated.
        Copy the contents of a resource file to this file.
        Parameters:
        resource - the path of the resource, relative to the package of this class
        overwrite - whether or not to overwrite the file if it already exists
        replaceNewLine - 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

        public abstract java.lang.String getName()
        Deprecated.
        Return the base name (last component) of the file name.
      • getPath

        public abstract java.lang.String 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

        public abstract boolean isSameFile​(DocFile other)
        Deprecated.
        Return true if this file is the same as another.
      • list

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

        public abstract boolean mkdirs()
        Deprecated.
        Create the file as a directory, including any parent directories.
      • resolve

        public abstract DocFile resolve​(DocPath p)
        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

        public abstract DocFile resolve​(java.lang.String p)
        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

        public abstract DocFile resolveAgainst​(javax.tools.JavaFileManager.Location locn)
        Deprecated.
        Resolve a relative file against the given output location.
        Parameters:
        locn - Currently, only DocumentationTool.Location#DOCUMENTATION_OUTPUT is supported.