I have to login into a https web page and download a file using Java. I know all the URLs beforehand:
baseURL = // a https URL;
urlMap = new HashMap
Perhaps you want to try HttpUnit. Although written with testing of websites in mind it may be usable for your problem.
From their website:
"... Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission, JavaScript, basic http authentication, cookies and automatic page redirection, and allows Java test code to examine returned pages either as text, an XML DOM, or containers of forms, tables, and links."