Package 

Class FileNameUtils

    • Method Summary

      Modifier and Type Method Description
      static String getExtension(String filename) Returns the extension (i.e.
      static String getBaseName(String filename) Returns the basename (i.e.
      • Methods inherited from class java.lang.Object

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

      • getExtension

         static String getExtension(String filename)

        Returns the extension (i.e. the part after the last ".") of a file.

        Will return an empty string if the file name doesn't containany dots. Only the last segment of a the file name is consulted- i.e. all leading directories of the {@code filename} parameter are skipped.

        Parameters:
        filename - the name of the file to obtain the extension of.
      • getBaseName

         static String getBaseName(String filename)

        Returns the basename (i.e. the part up to and not including thelast ".") of the last path segment of a filename.

        Will return the file name itself if it doesn't contain anydots. All leading directories of the {@code filename} parameterare skipped.

        Parameters:
        filename - the name of the file to obtain the basename of.