Привет всем хочу плагин собрать на JDownloader. Скачал исходник начинаю компилировать а он ошибку выдаёт. Помогите.
mannaz@ubuntu:~/upload/320/javo/jd$ javac Tester.java
Tester.java:10: package jd.http does not exist
import jd.http.Browser;
^
Tester.java:11: package jd.nutils.encoding does not exist
import jd.nutils.encoding.Encoding;
^
Tester.java:16: cannot find symbol
symbol : class Browser
location: class jd.Tester
Browser br = new Browser();
^
Tester.java:16: cannot find symbol
symbol : class Browser
location: class jd.Tester
Browser br = new Browser();
^
Tester.java:18: cannot find symbol
symbol : variable Encoding
location: class jd.Tester
System.out.println(Encoding.htmlDecode("14300921004cb82f694cbed%0D%0A"));
^
5 errors
я предполагаю что он выдаёт ошибку иза того что не хватает библиотек хотя всё на месте.
вот сам исходник
package jd;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import jd.http.Browser;
import jd.nutils.encoding.Encoding;
public class Tester {
public static void main(String[] args) throws Throwable {
Browser br = new Browser();
br.setDebug(true);
System.out.println(Encoding.htmlDecode("14300921004cb82f694cbed%0D%0A"));
}
@SuppressWarnings("unused")
private static String runCommand(final String serviceType, final String controlUrl, final String command) throws IOException {
String data = "<?xml version='1.0' encoding='utf-8'?> <s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <u:" + command + " xmlns:u='" + serviceType + "' /> </s:Body> </s:Envelope>";
// this works for fritz box.
// old code did NOT work:
// data =
// "<?xml version=\"1.0\"?>\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <s:Body>\n<m:"
// + command + " xmlns:m=\"" + serviceType + "\"></m:" + command + ">\n"
// + " </s:Body>\n" + "</s:Envelope>";
final URL url = new URL(controlUrl);
final URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.addRequestProperty("Content-Type", "text/xml; charset=\"utf-8\"");
conn.addRequestProperty("SOAPAction", serviceType + "#" + command);
// conn.addRequestProperty("SOAPAction", serviceType + "#" + command +
// "\"");
OutputStreamWriter wr = null;
BufferedReader rd = null;
try {
wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String xmlstr = "";
String nextln;
while ((nextln = rd.readLine()) != null) {
xmlstr += nextln.trim();
}
return xmlstr;
} finally {
if (wr != null) {
wr.close();
}
if (rd != null) {
rd.close();
}
}
}
}