ur_rna.Utilities

## Class PathTools.FileName

- java.lang.Object
- - ur_rna.Utilities.PathTools.FileName

- Enclosing class:
    PathTools

      public static class PathTools.FileName
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.String[]` | `EMPTY_ARRAY`
    `private int` | `extPos`
    `java.lang.String` | `fullPath`
    `private static java.util.regex.Pattern` | `reSlash`
    `private int` | `sepPos`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileName(java.lang.String fullPath)`
    `FileName(java.lang.String fullPath, boolean allowMultiDotExtensions)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `baseName()`
    `java.lang.String` | `changeExt(java.lang.String extension)`
    `java.lang.String` | `dir()` Returns the directory portion of the path, INCLUDING the final slash (!!) (The final slash may be necessary to distinguish eg.
    `java.lang.String` | `dir(boolean includeFinalSlash)`
    `java.lang.String` | `ext()`
    `java.lang.String` | `ext(boolean includeDot)`
    `boolean` | `hasDir()`
    `boolean` | `hasExt()`
    `java.lang.String` | `name()`
    `java.lang.String` | `removeExt()` Returns the original path, including the directory, but without any extension.
    `java.lang.String[]` | `splitDirs()` Return an array of all ancestor directories of the file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY_ARRAY

          private static java.lang.String[] EMPTY_ARRAY

    - #### extPos

          private final int extPos

    - #### fullPath

          public final java.lang.String fullPath

    - #### reSlash

          private static final java.util.regex.Pattern reSlash

    - #### sepPos

          private final int sepPos

  - ### Constructor Detail

    - #### FileName

          public FileName(java.lang.String fullPath)

    - #### FileName

          public FileName(java.lang.String fullPath,
                          boolean allowMultiDotExtensions)

  - ### Method Detail

    - #### baseName

          public java.lang.String baseName()

    - #### changeExt

          public java.lang.String changeExt(java.lang.String extension)

    - #### dir

          public java.lang.String dir()

      Returns the directory portion of the path, INCLUDING the final slash (!!) (The final slash may be necessary to distinguish eg. "/file.txt" from "file.txt" which would both have a directory of "" if the slash were discarded.)

    - #### dir

          public java.lang.String dir(boolean includeFinalSlash)

    - #### ext

          public java.lang.String ext()

      Returns:
        the file extension, preserving the initial dot.

    - #### ext

          public java.lang.String ext(boolean includeDot)

    - #### hasDir

          public boolean hasDir()

    - #### hasExt

          public boolean hasExt()

    - #### name

          public java.lang.String name()

    - #### removeExt

          public java.lang.String removeExt()

      Returns the original path, including the directory, but without any extension. e.g. for "C:\Users\John\Docs\hello.txt" this returns "C:\Users\John\Docs\hello" The final slash will
      Returns:

    - #### splitDirs

          public java.lang.String[] splitDirs()

      Return an array of all ancestor directories of the file. If the path begins with a slash, an empty string is the first element in the array. Examples: "/path/to/the/file.txt" would yield { "", "path", "to", "the } "relpath/to/the/file.txt" would yield { "relpath", "to", "the" } "file.txt" would yield { } (an empty array) "/file.txt" would yield { "" } (an array containing a single empty string)