Package com.globalmentor.io
Class Filenames.Extensions
java.lang.Object
com.globalmentor.io.Filenames.Extensions
- Enclosing class:
- Filenames
Utilities for working directly with filename extensions themselves, separate from filenames.
- Author:
- Garret Wilson
-
Method Summary
-
Method Details
-
normalize
Normalizes an extension to its ASCII lowercase form. Non-ASCII characters are unchanged. Thustxt
,TXT
, andtXt
will all return the normalized formtxt
.- Parameters:
extension
- The extension to normalize.- Returns:
- The normalized form of the extension.
-
equals
Checks to see if two extensions are equal. Comparison is done on an ASCII case-insensitive basic. Thustxt
,TXT
, andtXt
are all considered equal.- API Note:
- This API follows
Object.equals(Object)
andString.equalsIgnoreCase(String)
in allowing either or both arguments to benull
. - Implementation Specification:
- This implementation delegates to
ASCII.equalsIgnoreCase(CharSequence, CharSequence)
. - Parameters:
extension1
- The first extension to compare.extension2
- The second extension to compare.- Returns:
true
-