mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Add] URLs 增加一个工具类;
This commit is contained in:
parent
5ad2a56ce2
commit
4304cfcef2
13
src/main/java/net/lamgc/cgj/util/URLs.java
Normal file
13
src/main/java/net/lamgc/cgj/util/URLs.java
Normal file
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user