URL Parser를 하나 만들까 하는데, 여기저기 쓰이는 곳이 많길래
객체로 만들어서 재사용할까 하는데, 만들려고 생각해보니 귀찮습니다 ㅡ.ㅡ
자바에 URL Parser 수준의 class로 구현된 소스가 어디 없을까요?
그냥 가져다 쓰게요 ㅎㅎㅎ
public class ParseURL {
public static void main(String[] args) throws Exception {
URL aURL = new URL(" http://java.sun.com:80/docs/books/tutorial"
+ "/index.html?name=networking#DOWNLOADING");
System.out.println("protocol = " + aURL.getProtocol());
System.out.println("authority = " + aURL.getAuthority());
System.out.println("host = " + aURL.getHost());
System.out.println("port = " + aURL.getPort());
System.out.println("path = " + aURL.getPath());
System.out.println("query = " + aURL.getQuery());
System.out.println("filename = " + aURL.getFile());
System.out.println("ref = " + aURL.getRef());
}
}
|