PostelnicuGeorge commented on a change in pull request #236:
URL: https://github.com/apache/commons-compress/pull/236#discussion_r775399688



##########
File path: src/main/java/org/apache/commons/compress/utils/FileNameUtils.java
##########
@@ -50,6 +51,29 @@ public static String getExtension(final String filename) {
         return name.substring(extensionPosition + 1);
     }
 
+    /**
+     * Returns the extension (i.e. the part after the last ".") of a file.
+     * <p>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 {@code filename}
+     * parameter are skipped.</p>
+     * @return the extension of filename
+     * @param path the path of the file to obtain the extension of.
+     * @since 1.22
+     */
+    public static String getExtensionFrom(final Path path) {

Review comment:
       I thought of them as utility methods and it didn't even occur to me to 
unit test them. Will do so in the future!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to