This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Sorry about only leaving a link. I got an e-mail from someone saying that its better if i posted thge question here than they going back forth. Anyways here are the two questions
I have two rather silly questions about URLs but please bear with me for a while.
Usually when you use the URLConnection class to read from a website you don't get prompted for authentication but if you are trying to post something to that website you will usually require some kind of authentication.
Please assume that the authenticator class has been set correctly and that its getPasswordAuthentication() method returns the correct username and passsword
Consider this code
My problem is now i do not know that if i am going to post to that website(and it most certainly will need authentication) will i be prompted by the Authenticator class so i can get the outputstream and post to that website
I am not able to test this code because i currently do not have any website to post to but i am working on an application that could possibly do this.
Now in above code i am reading stream bytes but if i were using the PrintReader and putting the output to the console you would see all the server html commands and the byte content of the file but as rubbish text.
Now basically my question is when i read that file as stream bytes and save it to disk will all the html commands also be saved because that's not what i want. I only want the zip file.
I hope someone can help me with the above two questions