This website works better with JavaScript.
Home
Explore
Help
Sign In
bubblev
/
cobbzilla-utils
Watch
6
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
1
Wiki
Activity
Browse Source
add FileUtil.replaceExt
master
Jonathan Cobb
4 years ago
parent
091dea6bc3
commit
bcd403f6fd
1 changed files
with
5 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+5
-0
src/main/java/org/cobbzilla/util/io/FileUtil.java
+ 5
- 0
src/main/java/org/cobbzilla/util/io/FileUtil.java
View File
@@ -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;
}
}
Write
Preview
Loading…
Cancel
Save