I am testing my WebCrawler program that retrieve a web page and the images it contains to local storage, so that I can look at the web page loaded from my local file system.
This program takes command-line application that takes two arguments:
The first argument represents the download directory into which the web page will be downloaded. This argument can be relative to the directory where the java command is executed or an absolute directory. If the directory does not exist, throw a CrawlerException.
The second argument represents the absolute URL of the web page to download. This URL WILL end with .../<filename>.html. The original <filename>.html will be used to save the HTML of the page in the download directory.
Now, if I run like this, everything is OK.
java -classpath c:\classes dkim18.crawler.WebCrawler c:\classes\ http://webdev.apl.jhu.edu/%%7Emed/summer03/homework/05LibrarySwing.html
However, if I make jar file then my progarm doesn't create sub directory where supposed to download all relative images.
This is my manifest file.
jar -cvmf myManiFest dkim18.jar dkim18/
(all .classes files are under c:\classes\dkim18\crawler\
So, I can run it from any directory location via: java -jar dkim18.jar <download dir> <url>