diff --git a/src/main/java/org/cobbzilla/util/io/FileUtil.java b/src/main/java/org/cobbzilla/util/io/FileUtil.java index ae98361..47691fc 100644 --- a/src/main/java/org/cobbzilla/util/io/FileUtil.java +++ b/src/main/java/org/cobbzilla/util/io/FileUtil.java @@ -624,4 +624,9 @@ public class FileUtil { return found.get(); } + public static String replaceExt(String path, String ext) { + final int pos = path.lastIndexOf('.'); + return pos == -1 ? path + "." + ext : path.substring(0, pos) + ext; + } + }