ClassPath:

-added zip4j
BrowserAdapter:
-added getDownloadable
-updated to use getDownloadable
-fixes thread 71049, post 22
BrowserDownloadInterface:
-removed unused openDownload methods
-updated to use BrowserAdapter.getDownloadable

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@35120 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: 98d16273c888aa2f060de23cff9c331b3a66710a
This commit is contained in:
jiaz 2016-10-11 08:32:06 +00:00
parent 63a2254a40
commit d09ab1e8d4
4 changed files with 111 additions and 145 deletions

View File

@ -1,81 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="jd/plugins/optional/neembuu/|jd/plugins/optional/remoteserv/|jd/plugins/optional/remoteserv/|org/jdownloader/extensions/langfileeditor/" kind="src" path="src"/>
<classpathentry kind="src" path="src-closed"/>
<classpathentry kind="src" path="translations"/>
<classpathentry kind="src" path="themes"/>
<classpathentry excluding="org/jdownloader/nativeswing/OptionsAndPlaylistExample.java|org/jdownloader/nativeswing/SimpleVLCPlayerExample.java" kind="src" path="tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jd/ressourcen/libs/dbus"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/irclib.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/synthetica.jar" sourcepath="C:/Users/Thomas/Downloads/synthetica.src.2.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/jd/ressourcen/code-ressourcen/synthetica_docs.zip!/"/>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackStar.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueIce.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueSteel.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaMauveMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaOrangeMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSilverMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSimple2D.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSkyMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaWhiteVision.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/jna.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackEye.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaGreenDream.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/debug-disable.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/hexdump.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/libdbus-java.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/unix.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbinding.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/AppleJavaExtensions.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/JDBrowser"/>
<classpathentry combineaccessrules="false" kind="src" path="/AppWorkUtils"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingWin.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-core.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/miglayout.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingLinux.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingMac.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/MyJDownloaderClient"/>
<classpathentry kind="lib" path="ressourcen/libs/jna_platform.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-core.jar" sourcepath="C:/Users/Thomas/Desktop/cling-distribution-2.0.1">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-support.jar">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-http.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-util.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-xml.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/proxyVole.jar" sourcepath="/ProxyVole"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaAluOxide.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueLight.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaClassy.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/jsyntaxpane.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sqljet.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sequence-library.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/svnkit.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/antlr-runtime.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaPlain.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/bcprov-jdk15on.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/svgSalamander.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/image4j.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/Filters.jar" sourcepath="ressourcen/code-ressourcen/Filter_src.zip"/>
<classpathentry kind="lib" path="ressourcen/libs/htmlunit-core-js.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/js.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-databind.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-annotations.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="jd/plugins/optional/neembuu/|jd/plugins/optional/remoteserv/|jd/plugins/optional/remoteserv/|org/jdownloader/extensions/langfileeditor/" kind="src" path="src"/>
<classpathentry kind="src" path="src-closed"/>
<classpathentry kind="src" path="translations"/>
<classpathentry kind="src" path="themes"/>
<classpathentry excluding="org/jdownloader/nativeswing/OptionsAndPlaylistExample.java|org/jdownloader/nativeswing/SimpleVLCPlayerExample.java" kind="src" path="tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jd/ressourcen/libs/dbus"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/irclib.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/synthetica.jar" sourcepath="C:/Users/Thomas/Downloads/synthetica.src.2.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/jd/ressourcen/code-ressourcen/synthetica_docs.zip!/"/>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackStar.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueIce.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueSteel.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaMauveMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaOrangeMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSilverMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSimple2D.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSkyMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaWhiteVision.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/jna.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackEye.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaGreenDream.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/debug-disable.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/hexdump.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/libdbus-java.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/unix.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbinding.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/AppleJavaExtensions.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/JDBrowser"/>
<classpathentry combineaccessrules="false" kind="src" path="/AppWorkUtils"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingWin.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-core.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/miglayout.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingLinux.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingMac.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/MyJDownloaderClient"/>
<classpathentry kind="lib" path="ressourcen/libs/jna_platform.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-core.jar" sourcepath="C:/Users/Thomas/Desktop/cling-distribution-2.0.1">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-support.jar">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-http.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-util.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-xml.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/proxyVole.jar" sourcepath="/ProxyVole"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaAluOxide.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueLight.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaClassy.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/jsyntaxpane.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sqljet.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sequence-library.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/svnkit.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/antlr-runtime.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaPlain.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/bcprov-jdk15on.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/svgSalamander.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/image4j.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/Filters.jar" sourcepath="ressourcen/code-ressourcen/Filter_src.zip"/>
<classpathentry kind="lib" path="ressourcen/libs/htmlunit-core-js.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/js.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-databind.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-annotations.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/zip4j.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -16,19 +16,19 @@
package jd.plugins;
import org.appwork.storage.config.JsonConfig;
import org.jdownloader.settings.GeneralSettings;
import jd.controlling.downloadcontroller.SingleDownloadController;
import jd.controlling.reconnect.ipcheck.IP;
import jd.http.Browser;
import jd.http.Request;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.plugins.download.DownloadInterface;
import jd.plugins.download.DownloadLinkDownloadable;
import jd.plugins.download.Downloadable;
import jd.plugins.download.raf.OldRAFDownload;
import org.appwork.storage.config.JsonConfig;
import org.jdownloader.settings.GeneralSettings;
public class BrowserAdapter {
public static final int ERROR_REDIRECTED = -1;
@ -46,8 +46,19 @@ public class BrowserAdapter {
return dl;
}
public static Downloadable getDownloadable(DownloadLink downloadLink, Browser br) {
final SingleDownloadController controller = downloadLink.getDownloadLinkController();
if (controller != null) {
final PluginForHost plugin = controller.getProcessingPlugin();
if (plugin != null) {
return plugin.newDownloadable(downloadLink, br);
}
}
return null;
}
public static DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String link) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createRequest(link), false, 1);
return openDownload(br, getDownloadable(downloadLink, br), br.createRequest(link), false, 1);
}
public static DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String url, String postdata) throws Exception {
@ -170,15 +181,15 @@ public class BrowserAdapter {
}
public static DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String url, String postdata, boolean resume, int chunks) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createPostRequest(url, postdata), resume, chunks);
return openDownload(br, getDownloadable(downloadLink, br), br.createPostRequest(url, postdata), resume, chunks);
}
public static DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String link, boolean resume, int chunks) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createRequest(link), resume, chunks);
return openDownload(br, getDownloadable(downloadLink, br), br.createRequest(link), resume, chunks);
}
public static DownloadInterface openDownload(Browser br, DownloadLink downloadLink, Form form, boolean resume, int chunks) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createRequest(form), resume, chunks);
return openDownload(br, getDownloadable(downloadLink, br), br.createRequest(form), resume, chunks);
}
public static DownloadInterface openDownload(Browser br, DownloadLink downloadLink, Form form) throws Exception {

View File

@ -18,20 +18,18 @@ package jd.plugins;
import java.nio.charset.CharacterCodingException;
import org.appwork.storage.config.JsonConfig;
import org.jdownloader.settings.GeneralSettings;
import jd.controlling.reconnect.ipcheck.IP;
import jd.http.Browser;
import jd.http.Request;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.plugins.download.DownloadInterface;
import jd.plugins.download.DownloadLinkDownloadable;
import jd.plugins.download.Downloadable;
import jd.plugins.download.raf.OldRAFDownload;
import org.appwork.storage.config.JsonConfig;
import org.jdownloader.settings.GeneralSettings;
/**
* heavily modified download interface by raztoki
*
@ -42,7 +40,7 @@ public class BrowserDownloadInterface {
public static final int ERROR_REDIRECTED = -1;
public DownloadInterface getDownloadInterface(Downloadable downloadable, Request request, boolean resumeEnabled, int chunksCount) throws Exception {
protected DownloadInterface getDownloadInterface(Downloadable downloadable, Request request, boolean resumeEnabled, int chunksCount) throws Exception {
final OldRAFDownload dl = new OldRAFDownload(downloadable, request);
final int chunks = downloadable.getChunks();
if (chunksCount == 0) {
@ -54,14 +52,6 @@ public class BrowserDownloadInterface {
return dl;
}
public DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String link) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createRequest(link), false, 1);
}
public DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String url, String postdata) throws Exception {
return openDownload(br, downloadLink, url, postdata, false, 1);
}
/**
*
* @param br
@ -74,7 +64,7 @@ public class BrowserDownloadInterface {
* @return
* @throws Exception
*/
public DownloadInterface openDownload(Browser br, Downloadable downloadable, Request request, boolean resume, int chunks) throws Exception {
protected DownloadInterface openDownload(Browser br, Downloadable downloadable, Request request, boolean resume, int chunks) throws Exception {
String originalUrl = br.getURL();
DownloadInterface dl = getDownloadInterface(downloadable, request, resume, chunks);
downloadable.setDownloadInterface(dl);
@ -143,23 +133,6 @@ public class BrowserDownloadInterface {
return dl;
}
/**
*
* @param br
* @param downloadLink
* @param url
* @param postdata
* @param resume
* true|false, if chunks over 1 it must be true!
* @param chunks
* 0 = unlimited, chunks must start with negative sign otherwise it forces value to be used instead of up to value.
* @return
* @throws Exception
*/
public DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String url, String postdata, boolean resume, int chunks) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createPostRequest(url, postdata), resume, chunks);
}
/**
*
* @param br
@ -173,27 +146,7 @@ public class BrowserDownloadInterface {
* @throws Exception
*/
public DownloadInterface openDownload(Browser br, DownloadLink downloadLink, String link, boolean resume, int chunks) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createRequest(link), resume, chunks);
}
/**
*
* @param br
* @param downloadLink
* @param form
* @param resume
* true|false, if chunks over 1 it must be true!
* @param chunks
* 0 = unlimited, chunks must start with negative sign otherwise it forces value to be used instead of up to value.
* @return
* @throws Exception
*/
public DownloadInterface openDownload(Browser br, DownloadLink downloadLink, Form form, boolean resume, int chunks) throws Exception {
return openDownload(br, new DownloadLinkDownloadable(downloadLink), br.createRequest(form), resume, chunks);
}
public DownloadInterface openDownload(Browser br, DownloadLink downloadLink, Form form) throws Exception {
return openDownload(br, downloadLink, form, false, 1);
return openDownload(br, BrowserAdapter.getDownloadable(downloadLink, br), br.createRequest(link), resume, chunks);
}
/**
@ -205,7 +158,7 @@ public class BrowserDownloadInterface {
* @param br
* @throws PluginException
*/
public void handleBlockedConnection(final DownloadInterface dl, final Browser br) throws PluginException {
protected void handleBlockedConnection(final DownloadInterface dl, final Browser br) throws PluginException {
if (dl != null && br != null) {
if (dl.getConnection().getResponseCode() == 403) {
if ("Blocked by Bitdefender".equalsIgnoreCase(dl.getConnection().getResponseMessage())) {
@ -305,7 +258,7 @@ public class BrowserDownloadInterface {
* @param br
* @throws PluginException
*/
public void handleBlockedRedirect(final String redirect) throws PluginException {
protected void handleBlockedRedirect(final String redirect) throws PluginException {
if (redirect == null) {
return;
}

View File

@ -19,6 +19,7 @@ package jd.plugins.download;
import java.io.IOException;
import jd.http.Request;
import jd.plugins.BrowserAdapter;
import jd.plugins.DownloadLink;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@ -28,7 +29,7 @@ import jd.plugins.download.raf.OldRAFDownload;
public class RAFDownload extends OldRAFDownload {
public RAFDownload(PluginForHost plugin, DownloadLink downloadLink, Request request) throws IOException, PluginException {
super(new DownloadLinkDownloadable(downloadLink), request);
super(BrowserAdapter.getDownloadable(downloadLink, null), request);
}
@Deprecated