Click here to Skip to main content
11,570,759 members (55,617 online)
   

Java

 
GeneralRe: am a beginner Pin
Richard MacCutchan16-Jan-13 0:52
mvpRichard MacCutchan16-Jan-13 0:52 
GeneralRe: am a beginner Pin
cubocik16-Jan-13 0:55
membercubocik16-Jan-13 0:55 
GeneralRe: am a beginner Pin
onyebumichael16-Jan-13 11:03
grouponyebumichael16-Jan-13 11:03 
AnswerRe: am a beginner Pin
April Fans16-Jan-13 19:46
memberApril Fans16-Jan-13 19:46 
GeneralRe: am a beginner Pin
Richard MacCutchan16-Jan-13 23:40
mvpRichard MacCutchan16-Jan-13 23:40 
Questionhelp me please Pin
terzasek13-Jan-13 17:10
memberterzasek13-Jan-13 17:10 
AnswerRe: help me please Pin
Richard MacCutchan13-Jan-13 22:23
mvpRichard MacCutchan13-Jan-13 22:23 
AnswerRe: help me please Pin
Avidwan14-Jan-13 4:41
memberAvidwan14-Jan-13 4:41 
GeneralRe: help me please Pin
Richard MacCutchan14-Jan-13 6:22
mvpRichard MacCutchan14-Jan-13 6:22 
GeneralRe: help me please Pin
cubocik16-Jan-13 0:40
membercubocik16-Jan-13 0:40 
QuestionWebpage saver -- help Pin
cubocik13-Jan-13 7:38
membercubocik13-Jan-13 7:38 
SuggestionRe: Webpage saver -- help Pin
Richard MacCutchan13-Jan-13 22:18
mvpRichard MacCutchan13-Jan-13 22:18 
GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 5:51
membercubocik14-Jan-13 5:51 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan14-Jan-13 6:12
mvpRichard MacCutchan14-Jan-13 6:12 
You are missing a few #import statements, and you are also trying to read from your output stream. Try this:
import java.io.*;
import java.net.*;
 
public class webpagesaver{
    public static void main(String[] args) throws IOException{
    
        String saveFile = "PaginaCopiada.html"; //name of SaveFile
        String location = "http://www.sapo.pt"; // website url withou #
        URL url = new URL(location);
        URLConnection conn = url.openConnection();
        InputStream is = conn.getInputStream();
        conn.connect();
        BufferedWriter out = new BufferedWriter(new FileWriter(saveFile));
        BufferedReader in = new BufferedReader(new InputStreamReader(is));
        String l = in.readLine();
        while(l!=null){
            out.write(l);
            out.newLine();
        }
        in.close();
        out.close();
    }    
}
One of these days I'm going to think of a really clever signature.

GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 6:34
membercubocik14-Jan-13 6:34 
GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 6:39
membercubocik14-Jan-13 6:39 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan14-Jan-13 6:55
mvpRichard MacCutchan14-Jan-13 6:55 
GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 7:55
membercubocik14-Jan-13 7:55 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan14-Jan-13 22:02
mvpRichard MacCutchan14-Jan-13 22:02 
GeneralRe: Webpage saver -- help Pin
cubocik16-Jan-13 0:38
membercubocik16-Jan-13 0:38 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan16-Jan-13 0:51
mvpRichard MacCutchan16-Jan-13 0:51 
QuestionHow to Record Audio at client Side? Pin
Mrugrajsinh13-Jan-13 7:19
memberMrugrajsinh13-Jan-13 7:19 
Questioncode error Pin
Member 975139812-Jan-13 12:47
memberMember 975139812-Jan-13 12:47 
AnswerRe: code error Pin
Richard MacCutchan12-Jan-13 23:35
mvpRichard MacCutchan12-Jan-13 23:35 
QuestionRegarding Maven and Jenkins Pin
sivaKrishna joga2-Jan-13 22:47
membersivaKrishna joga2-Jan-13 22:47 
AnswerRe: Regarding Maven and Jenkins Pin
Richard MacCutchan3-Jan-13 0:12
mvpRichard MacCutchan3-Jan-13 0:12 
GeneralRe: Regarding Maven and Jenkins Pin
sivaKrishna joga3-Jan-13 0:23
membersivaKrishna joga3-Jan-13 0:23 
GeneralRe: Regarding Maven and Jenkins Pin
Richard MacCutchan3-Jan-13 1:06
mvpRichard MacCutchan3-Jan-13 1:06 
GeneralRe: Regarding Maven and Jenkins Pin
sivaKrishna joga3-Jan-13 1:13
membersivaKrishna joga3-Jan-13 1:13 
GeneralRe: Regarding Maven and Jenkins Pin
Richard MacCutchan3-Jan-13 1:58
mvpRichard MacCutchan3-Jan-13 1:58 
GeneralRe: Regarding Maven and Jenkins Pin
sivaKrishna joga3-Jan-13 2:16
membersivaKrishna joga3-Jan-13 2:16 
AnswerRe: Regarding Maven and Jenkins Pin
April Fans3-Jan-13 15:39
memberApril Fans3-Jan-13 15:39 
Questionjava TLS Sending Email Pin
renishkhunt2-Jan-13 18:52
memberrenishkhunt2-Jan-13 18:52 
AnswerRe: java TLS Sending Email Pin
Phat (Phillip) H. VU2-Jan-13 22:08
memberPhat (Phillip) H. VU2-Jan-13 22:08 
GeneralRe: java TLS Sending Email Pin
renishkhunt2-Jan-13 23:26
memberrenishkhunt2-Jan-13 23:26 
GeneralRe: java TLS Sending Email Pin
Phat (Phillip) H. VU3-Jan-13 0:12
memberPhat (Phillip) H. VU3-Jan-13 0:12 
GeneralRe: java TLS Sending Email Pin
Phat (Phillip) H. VU3-Jan-13 20:09
memberPhat (Phillip) H. VU3-Jan-13 20:09 
QuestionGeneric BST helpp!! Pin
yanikaA2-Jan-13 4:23
memberyanikaA2-Jan-13 4:23 
QuestionJSF Pin
rkpandey201331-Dec-12 0:20
memberrkpandey201331-Dec-12 0:20 
AnswerRe: JSF Pin
Richard MacCutchan31-Dec-12 0:54
mvpRichard MacCutchan31-Dec-12 0:54 
AnswerRe: JSF Pin
Richard MacCutchan7-Jan-13 6:31
mvpRichard MacCutchan7-Jan-13 6:31 
QuestionJSF with Tiles Pin
gurpreetsingh201531-Dec-12 0:12
membergurpreetsingh201531-Dec-12 0:12 
AnswerRe: JSF with Tiles Pin
rkpandey201331-Dec-12 0:21
memberrkpandey201331-Dec-12 0:21 
AnswerRe: JSF with Tiles Pin
Richard MacCutchan31-Dec-12 0:54
mvpRichard MacCutchan31-Dec-12 0:54 
QuestionAnnotation Pin
Vijay Kumar Jaiswal30-Dec-12 18:20
groupVijay Kumar Jaiswal30-Dec-12 18:20 
AnswerRe: Annotation Pin
TorstenH.30-Dec-12 21:35
memberTorstenH.30-Dec-12 21:35 
AnswerRe: Annotation Pin
Phat (Phillip) H. VU2-Jan-13 22:14
memberPhat (Phillip) H. VU2-Jan-13 22:14 
AnswerRe: Annotation Pin
April Fans3-Jan-13 15:44
memberApril Fans3-Jan-13 15:44 
AnswerRe: Annotation Pin
muthu shankar7-Jan-13 4:30
membermuthu shankar7-Jan-13 4:30 
AnswerRe: Annotation Pin
April Fans16-Jan-13 21:58
memberApril Fans16-Jan-13 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 1 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid