Class FileNameUtils

java.lang.Object
org.apache.commons.compress.utils.FileNameUtils

@Deprecated public class FileNameUtils extends Object
Deprecated.
Generic file name utilities.
Since:
1.20
  • Constructor Details Link icon

  • Method Details Link icon

    • getBaseName Link icon

      @Deprecated public static String getBaseName(Path path)
      Deprecated.
      Gets the base name (i.e. the part up to and not including the last ".") of the last path segment of a file name.

      Will return the file name itself if it doesn't contain any dots. All leading directories of the file name parameter are skipped.

      Parameters:
      path - the path of the file to obtain the base name of.
      Returns:
      the base name of file name
      Since:
      1.22
    • getBaseName Link icon

      @Deprecated public static String getBaseName(String fileName)
      Gets the base name (i.e. the part up to and not including the last ".") of the last path segment of a file name.

      Will return the file name itself if it doesn't contain any dots. All leading directories of the file name parameter are skipped.

      Parameters:
      fileName - the name of the file to obtain the base name of.
      Returns:
      the base name of file name
    • getExtension Link icon

      @Deprecated public static String getExtension(Path path)
      Gets the extension (i.e. the part after the last ".") of a file.

      Will return an empty string if the file name doesn't contain any dots. Only the last segment of a the file name is consulted - i.e. all leading directories of the file name parameter are skipped.

      Parameters:
      path - the path of the file to obtain the extension of.
      Returns:
      the extension of file name
      Since:
      1.22
    • getExtension Link icon

      @Deprecated public static String getExtension(String fileName)
      Gets the extension (i.e. the part after the last ".") of a file.

      Will return an empty string if the file name doesn't contain any dots. Only the last segment of a the file name is consulted - i.e. all leading directories of the fileName parameter are skipped.

      Parameters:
      fileName - the name of the file to obtain the extension of.
      Returns:
      the extension of file name