___              _ _ ____
   /   |  __________(_|_) __ \____  _  ____  __
  / /| | / ___/ ___/ / / / / / __ \| |/_/ / / /
 / ___ |(__  ) /__/ / / /_/ / /_/ />  </ /_/ /
/_/  |_/____/\___/_/_/_____/\____/_/|_|\__, /
                                      /____/

Kotlin transcoded from Java

This is an example demonstrating documentation for a Java project transcoded to Kotlin. The used source code files come from the Apache Commons IO project.

This is not meant to be complete documentation. Some links in the documentation may not work due to missing documentation.
Doxygen configuration
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY       = $(OUTPUT_DIR)

# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.

GENERATE_HTML          = NO

# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.

GENERATE_LATEX         = NO

# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML           = YES

# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.

JAVADOC_AUTOBRIEF      = YES

# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.

OPTIMIZE_OUTPUT_JAVA   = YES

# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.

FILTER_PATTERNS        = *.java="sed -E 's/@(Nullable|NonNull|CheckForNull|PossiblyNull)([[:space:]]+[[:alnum:]_])/__AT__\1__\2/g'"
AsciiDoxy directives
${language("kotlin", source="java")}
${insert("org.apache.commons.io.FileCleaningTracker")}
${insert("org.apache.commons.io.FileDeleteStrategy")}

FileCleaningTracker

class org.apache.commons.io.FileCleaningTracker

Keeps track of files awaiting deletion, and deletes them when an associated marker object is reclaimed by the garbage collector.

This utility creates a background thread to handle file deletion. Each file to be deleted is registered with a handler object. When the handler object is garbage collected, the file is deleted.

In an environment with multiple class loaders (a servlet container, for example), you should consider stopping the background thread if it is no longer needed. This is done by invoking the method exitWhenFinished, typically in

javax.servlet.ServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)

or similar.

Public Methods

getTrackCount(): Int

Retrieve the number of files currently being tracked, and therefore awaiting deletion.

getDeleteFailures(): List<String!>!

Return the file paths that failed to delete.

Members

fun getTrackCount(): Int

Retrieve the number of files currently being tracked, and therefore awaiting deletion.

Returns

Int

the number of files being tracked


fun getDeleteFailures(): List<String!>!

Return the file paths that failed to delete.

Returns

List<String!>!

the file paths that failed to delete


FileDeleteStrategy

class org.apache.commons.io.FileDeleteStrategy

Strategy for deleting files.

There is more than one way to delete a file. You may want to limit access to certain directories, to only delete directories if they are empty, or maybe to force deletion.

This class captures the strategy to use and is designed for user subclassing.

Public Constants

const val NORMAL: FileDeleteStrategy

The singleton instance for normal file deletion, which does not permit the deletion of directories that are not empty.

const val FORCE: FileDeleteStrategy

The singleton instance for forced file deletion, which always deletes, even if the file represents a non-empty directory.

Public Methods

deleteQuietly(final File!): Boolean

Deletes the file object, which may be a file or a directory.

toString(): String!

Gets a string describing the delete strategy.

Protected Constructors

FileDeleteStrategy(final String!)

Restricted constructor.

Protected Methods

doDelete(final File!): Boolean

Actually deletes the file object, which may be a file or a directory.

Members

const val NORMAL: FileDeleteStrategy

The singleton instance for normal file deletion, which does not permit the deletion of directories that are not empty.


const val FORCE: FileDeleteStrategy

The singleton instance for forced file deletion, which always deletes, even if the file represents a non-empty directory.


fun deleteQuietly(fileToDelete: final File!): Boolean

Deletes the file object, which may be a file or a directory.

All IOExceptions are caught and false returned instead. If the file does not exist or is null, true is returned.

Subclass writers should override doDelete(File), not this method.

Parameters

fileToDelete: final File!

the file to delete, null returns true

Returns

Boolean

true if the file was deleted, or there was no such file


fun toString(): String!

Gets a string describing the delete strategy.

Returns

String!

a string describing the delete strategy


fun FileDeleteStrategy(name: final String!)

Restricted constructor.

Parameters

name: final String!

the name by which the strategy is known


fun doDelete(fileToDelete: final File!): Boolean

Actually deletes the file object, which may be a file or a directory.

This method is designed for subclasses to override. The implementation may return either false or an IOException when deletion fails. The delete(File) and deleteQuietly(File) methods will handle either response appropriately. A check has been made to ensure that the file will exist.

This implementation uses File#delete().

Parameters

fileToDelete: final File!

the file to delete, exists, not null

Returns

Boolean

true if the file was deleted

Throws

NullPointerException!

if the file is null

IOException!

if an error occurs during file deletion


AsciiDoxy