src/main/java/com/gitblit/utils/StringUtils.java
@@ -556,6 +556,20 @@ } /** * Returns the file extension of a path. * * @param path * @return a blank string or a file extension */ public static String stripFileExtension(String path) { int lastDot = path.lastIndexOf('.'); if (lastDot > -1) { return path.substring(0, lastDot); } return path; } /** * Replace all occurences of a substring within a string with * another string. *