Note: Do not wait until the last minute to start this assignment. If you are inexperienced with Java or Unix, please look at the tutorials posted on the course webpage and ask questions early.
URL Examples: http://www.cs.odu.edu/~mweigle/courses/cs455-f07/schedule.html http://www.fakehost.com:765/fakepath/fakefile.html
The hostname is shown in bold font, and everything after the first '/' following the hostname is part of the path.
Example 1
% java UrlParser http://www.cs.odu.edu/~mweigle/foo.txt URL : http://www.cs.odu.edu/~mweigle/foo.txt Host: www.cs.odu.edu Port: 80 Path: /~mweigle/foo.txt
Example 2
% java UrlParser http://www.amazon.com:4567/Harry_Potter/this/is/a/book.html URL : http://www.amazon.com:4567/Harry_Potter/this/is/a/book.html Host: www.amazon.com Port: 4567 Path: /Harry_Potter/this/is/a/book.html
Example 3
% java UrlParser http://www.amazon.com URL : http://www.amazon.com Host: www.amazon.com Port: 80 Path: /
Example 4
% java UrlParser http://www.amazon.com/ URL : http://www.amazon.com Host: www.amazon.com Port: 80 Path: /
Example 5
% java UrlParser Usage: java UrlParser URL
Directions for submitting your assignment through Blackboard
Here is the skeleton for Program 1 (to be saved as UrlParser.java):
// Insert Your Name // Insert Your Class (CS 455 or CS 555), Fall 2007 // Program 1 - URL Parser import java.io.*; class UrlParser { public static void main (String argv[]) { // insert your code here } }