Package org.atlanmod.commons.io
Class MoreFiles
- java.lang.Object
-
- org.atlanmod.commons.io.MoreFiles
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringfileExtension(File file)Returns the file extension for the givenfile, or the empty string if the file has no extension.static StringfileExtension(String fullName)Returns the file extension for the given file name, or the empty string if the fullName has no extension.static StringnameWithoutExtension(File file)Returns thefilename without its file extension or path.static StringnameWithoutExtension(String fullName)Returns the file name without its fullName extension or path.
-
-
-
Method Detail
-
fileExtension
@Nonnull public static String fileExtension(File file)
Returns the file extension for the givenfile, or the empty string if the file has no extension. The result does not include the '.'.- Parameters:
file- the file- Returns:
- the file extension
-
fileExtension
@Nonnull public static String fileExtension(String fullName)
Returns the file extension for the given file name, or the empty string if the fullName has no extension. The result does not include the '.'.- Parameters:
fullName- the file name- Returns:
- the fullName extension
-
nameWithoutExtension
@Nonnull public static String nameWithoutExtension(File file)
Returns thefilename without its file extension or path. This is similar to thebasenameunix command. The result does not include the '.'.- Parameters:
file- the file- Returns:
- the file name without its extension
-
nameWithoutExtension
@Nonnull public static String nameWithoutExtension(String fullName)
Returns the file name without its fullName extension or path. This is similar to thebasenameunix command. The result does not include the '.'.- Parameters:
fullName- the file name- Returns:
- the fullName name without its extension
-
-