mirror of
https://github.com/octopusYan/alist-gui.git
synced 2025-01-31 10:06:43 +08:00
chore: rename BodyHandler
This commit is contained in:
parent
9e9a1b22b7
commit
50cba0557f
@ -1,7 +1,7 @@
|
|||||||
package cn.octopusyan.alistgui.manager.http;
|
package cn.octopusyan.alistgui.manager.http;
|
||||||
|
|
||||||
import cn.octopusyan.alistgui.enums.ProxySetup;
|
import cn.octopusyan.alistgui.enums.ProxySetup;
|
||||||
import cn.octopusyan.alistgui.manager.http.handler.BodyHandler;
|
import cn.octopusyan.alistgui.manager.http.handler.DownloadBodyHandler;
|
||||||
import cn.octopusyan.alistgui.model.ProxyInfo;
|
import cn.octopusyan.alistgui.model.ProxyInfo;
|
||||||
import cn.octopusyan.alistgui.util.JsonUtil;
|
import cn.octopusyan.alistgui.util.JsonUtil;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
@ -126,7 +126,7 @@ public class HttpUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 下载处理器
|
// 下载处理器
|
||||||
var handler = BodyHandler.create(
|
var handler = DownloadBodyHandler.create(
|
||||||
Path.of(savePath),
|
Path.of(savePath),
|
||||||
StandardOpenOption.CREATE, StandardOpenOption.WRITE
|
StandardOpenOption.CREATE, StandardOpenOption.WRITE
|
||||||
);
|
);
|
||||||
|
@ -21,16 +21,16 @@ import java.util.function.Consumer;
|
|||||||
* @author octopus_yan
|
* @author octopus_yan
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BodyHandler implements HttpResponse.BodyHandler<Path> {
|
public class DownloadBodyHandler implements HttpResponse.BodyHandler<Path> {
|
||||||
private final HttpResponse.BodyHandler<Path> handler;
|
private final HttpResponse.BodyHandler<Path> handler;
|
||||||
private BiConsumer<Long, Long> consumer;
|
private BiConsumer<Long, Long> consumer;
|
||||||
|
|
||||||
private BodyHandler(HttpResponse.BodyHandler<Path> handler) {
|
private DownloadBodyHandler(HttpResponse.BodyHandler<Path> handler) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BodyHandler create(Path directory, OpenOption... openOptions) {
|
public static DownloadBodyHandler create(Path directory, OpenOption... openOptions) {
|
||||||
return new BodyHandler(HttpResponse.BodyHandlers.ofFileDownload(directory, openOptions));
|
return new DownloadBodyHandler(HttpResponse.BodyHandlers.ofFileDownload(directory, openOptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
Loading…
Reference in New Issue
Block a user