urlchecker.java

来自「这是一个用于测试用的搜索引擎的案例」· Java 代码 · 共 44 行

JAVA
44
字号
package ir.webutils;import java.net.*;/** * URLChecker.java * trys to clean up some URLs that do not conform to the standard and cause confusion.  Valid URL's are returned  * unchanged.  The idea behind this class is to fix some common problems (like leaving spaces in URLs) with  * simple heuristics. * * June 1, 2001 * Ted Wild */public class URLChecker {      public static URL getURL(String urlString) throws MalformedURLException {	String checkedUrl = urlString.replace(' ', '+');	return new URL(checkedUrl);    }	        private URLChecker() {    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?