Hi, I'm having trouble getting my program to compile with the following error:
lineCheckerV2.java:97: cannot find symbol
symbol : method getResponseCode()
location: class java.net.URLConnection
int code = conn.getResponseCode();
I have imported the following packages (made sure I have the latest versions as well)
import java.net.*;
import java.net.URLConnection.*;
import java.net.HttpURLConnection.*;
import java.net.URL.*;
import java.io.*;
import javax.swing.*;
import javax.swing.text.html.parser.*;
import javax.swing.text.html.*;
import javax.swing.text.*;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
import java.util.*;
import java.util.List.*;
here is the offending code
List<String> result = new ArrayList<String>(getLinks(args[0]));
int n = result.size();
for(int i = 0; i < n ; i++)
{
System.out.println( result.get(i) );
URL link = new URL( result.get(i) );
URLConnection conn = link.openConnection();
int code = conn.getResponseCode();
System.out.println("rescode = " + code);
}
^
Any ideas - I'm pulling my hair out here...
thanks in advance
Edited by: alarm on Apr 25, 2010 3:08 AM