File: URLTest.java

package info (click to toggle)
libtritonus-java 20070428-9
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,948 kB
  • sloc: ansic: 53,816; java: 45,226; sh: 3,022; makefile: 1,188; xml: 820; cpp: 147
file content (40 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import	java.net.URL;
import	java.net.MalformedURLException;

import	org.tritonus.sampled.cdda.CddaURLStreamHandlerFactory;



public class URLTest
{
	static
	{
		URL.setURLStreamHandlerFactory(new CddaURLStreamHandlerFactory());
	}



	public static void main(String[] args)
	{
		String	strURL = args[0];
		URL	url = null;
		try
		{
			url = new URL(strURL);
		}
		catch (MalformedURLException e)
		{
			e.printStackTrace();
			System.exit(1);
		}
		System.out.println("authority: " + url.getAuthority());
		System.out.println("file: " + url.getFile());
		System.out.println("host: " + url.getHost());
		System.out.println("path: " + url.getPath());
		System.out.println("port: " + url.getPort());
		System.out.println("protocol: " + url.getProtocol());
		System.out.println("query: " + url.getQuery());
		System.out.println("ref: " + url.getRef());
		System.out.println("user info: " + url.getUserInfo());
	}
}