loc*_*one 9 java url normalization
I would like to ask if there's any Java package or library that have the standard URL normalization?
5 Components of URL Representation
http://www[dot]example[dot]com:8040/folder/exist?name=sky#head
The 3 types of standard URL normalization
Syntax-Based Normalization
Scheme-Based Normalization
Protocol-Based Normalization
正如其他人所提到的,java.net.URL和/或java.net.URI是一些明显的起点.
这里有一些其他选择:
Galimatias(西班牙语中的"乱码")似乎是一个自以为是且相对流行的Java URL规范化库.源代码可以在github.com/smola/galimatias找到.
galimatias开始时对java.net.URL和java.net.URI感到沮丧.它们都适用于基本用例,但对其他用户则严重破坏
该github.com/sentric/url-normalization库提供它颠倒了域部分的另一个(不寻常的,在我看来)的方式; 例如"com.stackoverflow"而不是"stackoverflow.com".
您可以在Github上找到其他变体,有时用Python,Ruby和PHP等语言实现.
URI uri = URI.create("http://www.example.com:8040/folder/exist?name=sky#head");
String scheme = uri.getScheme();
String authority = uri.getAuthority();
// ...
Run Code Online (Sandbox Code Playgroud)
https://docs.oracle.com/javase/1.5.0/docs/api/java/net/URI.html
| 归档时间: |
|
| 查看次数: |
8578 次 |
| 最近记录: |