diff --git a/src/main/java/net/lamgc/cgj/util/URLs.java b/src/main/java/net/lamgc/cgj/util/URLs.java new file mode 100644 index 0000000..63e5727 --- /dev/null +++ b/src/main/java/net/lamgc/cgj/util/URLs.java @@ -0,0 +1,13 @@ +package net.lamgc.cgj.util; + +public final class URLs { + + private URLs() {} + + public static String getResourceName(String url) { + int startIndex = Math.max(url.lastIndexOf("\\"), url.lastIndexOf("/")); + return url.substring(startIndex + 1); + } + + +}