Skip to content

Commit

Permalink
update version to 0.95
Browse files Browse the repository at this point in the history
  • Loading branch information
dipoo committed Apr 15, 2019
1 parent fd1008a commit 810a509
Show file tree
Hide file tree
Showing 39 changed files with 111 additions and 111 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ org.arong.egdownloader.ui.Main

适合里站,表站未知;

百度网盘:[egdownloader0.90.exe](https://pan.baidu.com/s/19Z7eqOm41arJ9IJV-Ascog) 下载
百度网盘:[egdownloader0.95.exe](https://pan.baidu.com/s/1Za_diYdowWLzZmybEcSkjA) 提取码:jww2

Binary file modified ext/egdownloader.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion script/egversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"0.90","url":"https://pan.baidu.com/s/19Z7eqOm41arJ9IJV-Ascog","jarVersion":"1","jarUrl":"https://raw.githubusercontent.com/dipoo/egdownloader/master/ext/egdownloader.jar"}
{"version":"0.95","url":"https://pan.baidu.com/s/1Za_diYdowWLzZmybEcSkjA","baidu_pan_code":"jww2","jarVersion":"1","jarUrl":"https://raw.githubusercontent.com/dipoo/egdownloader/master/ext/egdownloader.jar"}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.arong.egdownloader.model.Picture;
import org.arong.egdownloader.ui.ComponentConst;
import org.arong.util.Dom4jUtil;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
Expand Down Expand Up @@ -43,7 +43,7 @@ public static void updateDom(){
try {
dom = Dom4jUtil.getDOM(ComponentConst.PICTURE_XML_DATA_PATH);
} catch (DocumentException e) {
FileUtil.ifNotExistsThenCreate(ComponentConst.DATA_PATH);
FileUtil2.ifNotExistsThenCreate(ComponentConst.DATA_PATH);
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><pictures></pictures>";
int length = 0; //每一次读取的长度
char[] buffer = new char[2048]; //设缓冲最大值为2048字符
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.arong.egdownloader.ui.ComponentConst;
import org.arong.util.CodeUtil;
import org.arong.util.Dom4jUtil;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
Expand All @@ -36,7 +36,7 @@ public static void updateDom(){
try {
dom = Dom4jUtil.getDOM(ComponentConst.SETTING_XML_DATA_PATH);
} catch (DocumentException e) {
FileUtil.ifNotExistsThenCreate(ComponentConst.DATA_PATH);
FileUtil2.ifNotExistsThenCreate(ComponentConst.DATA_PATH);
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><settings></settings>";
int length = 0; //每一次读取的长度
char[] buffer = new char[2048]; //设缓冲最大值为2048字符
Expand Down
4 changes: 2 additions & 2 deletions src/org/arong/egdownloader/db/impl/TaskDom4jDbTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.arong.egdownloader.model.TaskStatus;
import org.arong.egdownloader.ui.ComponentConst;
import org.arong.util.Dom4jUtil;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
Expand Down Expand Up @@ -47,7 +47,7 @@ public static void updateDom(){
try {
dom = Dom4jUtil.getDOM(ComponentConst.TASK_XML_DATA_PATH);
} catch (DocumentException e) {
FileUtil.ifNotExistsThenCreate(ComponentConst.DATA_PATH);
FileUtil2.ifNotExistsThenCreate(ComponentConst.DATA_PATH);
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><tasks></tasks>";
int length = 0; //每一次读取的长度
char[] buffer = new char[2048]; //设缓冲最大值为2048字符
Expand Down
10 changes: 5 additions & 5 deletions src/org/arong/egdownloader/model/ScriptParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.arong.egdownloader.spider.WebClient;
import org.arong.egdownloader.ui.window.CreatingWindow;
import org.arong.egdownloader.version.Version;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.arong.util.JsonUtil;
import org.arong.util.Tracker;

Expand Down Expand Up @@ -143,7 +143,7 @@ public static Task buildTaskByJavaScript(Task task, Setting setting, JDialog win
}
String source = WebClient.getRequestUseJavaWithCookie(task.getUrl(), "UTF-8", setting.getCookieInfo());//WebClient.postRequestWithCookie(task.getUrl(), setting.getCookieInfo());
//保存源文件
FileUtil.storeStr2file(source, "source/", "task.html");
FileUtil2.storeStr2file(source, "source/", "task.html");
Map<String, Object> param = new HashMap<String, Object>();
param.put("htmlSource", source);

Expand Down Expand Up @@ -232,10 +232,10 @@ public static Task buildTaskByJavaScript(Task task, Setting setting, JDialog win
private static String genSaveDir(Task task){
String s = null;
if(task.isSaveDirAsSubname() && StringUtils.isNotBlank(task.getSubname())){
s = FileUtil.filterDir(task.getSubname());
s = FileUtil2.filterDir(task.getSubname());
}
if(StringUtils.isBlank(s)){
s = FileUtil.filterDir(task.getName());
s = FileUtil2.filterDir(task.getName());
}
return task.getSaveDir() + "/" + s;
}
Expand Down Expand Up @@ -328,7 +328,7 @@ public static String getdownloadUrl(Task task, String sourceUrl, Setting setting
String source = WebClient.getRequestUseJavaWithCookie(sourceUrl, "UTF-8", setting.getCookieInfo());
try {
//保存源文件
FileUtil.storeStr2file(source, "source/", "download.html");
FileUtil2.storeStr2file(source, "source/", "download.html");
Map<String, Object> param = new HashMap<String, Object>();
param.put("htmlSource", source);
param.put("version", Version.VERSION);
Expand Down
12 changes: 6 additions & 6 deletions src/org/arong/egdownloader/model/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.arong.egdownloader.ui.work.CreateWorker;
import org.arong.egdownloader.ui.work.DownloadWorker;
import org.arong.egdownloader.ui.work.ReCreateWorker;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
/**
* 任务模型
* @author 阿荣
Expand Down Expand Up @@ -91,7 +91,7 @@ public int storeStream(String path, String name, InputStream in) throws IOExcept
return 0;
}
File dir = new File(path);
FileUtil.ifNotExistsThenCreate(dir);
FileUtil2.ifNotExistsThenCreate(dir);
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
int size = 0;
Expand All @@ -104,7 +104,7 @@ public int storeStream(String path, String name, InputStream in) throws IOExcept
while ((len = bis.read(buff)) != -1) {
size += len;
byteLength += len;
FileUtil.byteLength += len;
FileUtil2.byteLength += len;
bos.write(buff, 0, len);
}
bos.flush();
Expand Down Expand Up @@ -411,7 +411,7 @@ public TimerTask getTimerTask() {
public void run() {
//当前一秒内的流量
Long length = byteLength - oldByteLength;
setDownSpeed(FileUtil.showSizeStr(length) + "/S");
setDownSpeed(FileUtil2.showSizeStr(length) + "/S");
if(byteLength > 999900000){
byteLength = 0L;
oldByteLength = 0L;
Expand Down Expand Up @@ -490,8 +490,8 @@ public void setSaveDirAsSubname(boolean saveDirAsSubname) {

public String getRealSaveDirName(){
if(saveDirAsSubname && subname != null){
return FileUtil.filterDir(StringUtils.isNotBlank(subname.trim()) ? subname.trim() : name);
return FileUtil2.filterDir(StringUtils.isNotBlank(subname.trim()) ? subname.trim() : name);
}
return FileUtil.filterDir(name);
return FileUtil2.filterDir(name);
}
}
8 changes: 4 additions & 4 deletions src/org/arong/egdownloader/ui/SwingPrintStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import org.arong.egdownloader.ui.panel.ConsolePanel;
import org.arong.util.DateUtil;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.arong.utils.StringUtil;

/**
Expand All @@ -31,11 +31,11 @@ public class SwingPrintStream extends PrintStream {
}
static BufferedWriter logfw = null;
static{
String binPath = FileUtil.getAppPath(SwingPrintStream.class);
String binPath = FileUtil2.getProjectPath();
if(binPath.endsWith("bin")){
binPath = binPath.substring(0, binPath.length() - 3);
}else{
FileUtil.ifNotExistsThenCreate("");
FileUtil2.ifNotExistsThenCreate("");
File f = new File("");
binPath = f.getAbsolutePath();
}
Expand All @@ -44,7 +44,7 @@ public class SwingPrintStream extends PrintStream {
try {
//大于20M则另存为
if(logfile.exists() && logfile.length() > 1024 * 1024 * 20){
logfile.renameTo(new File(FileUtil.getProjectPath() + File.separator + "console.log." + sdf2.format(new Date())));
logfile.renameTo(new File(FileUtil2.getProjectPath() + File.separator + "console.log." + sdf2.format(new Date())));
}
logfw = new BufferedWriter(new FileWriter(logfile, true), 4096);
} catch (IOException e) {
Expand Down
4 changes: 2 additions & 2 deletions src/org/arong/egdownloader/ui/list/GroupList.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.arong.egdownloader.ui.window.EgDownloaderWindow;
import org.arong.egdownloader.ui.window.GroupWindow;
import org.arong.egdownloader.ui.window.InitWindow;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.arong.util.Tracker;
/**
* 任务组列表
Expand Down Expand Up @@ -136,7 +136,7 @@ public void actionPerformed(ActionEvent e) {
}
File file = new File(ComponentConst.ROOT_DATA_PATH + "/" + name);
if(file.exists()){
FileUtil.deleteFile(file);
FileUtil2.deleteFile(file);
}
File dataFile = new File(ComponentConst.ROOT_DATA_PATH);
if(!dataFile.exists()){
Expand Down
6 changes: 3 additions & 3 deletions src/org/arong/egdownloader/ui/menuitem/OpenLogMenuItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import javax.swing.JMenuItem;

import org.arong.egdownloader.ui.window.EgDownloaderWindow;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.arong.util.Tracker;
/**
* 打开日志文件
Expand All @@ -27,12 +27,12 @@ public OpenLogMenuItem(String text, final EgDownloaderWindow mainWindow){
this.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
try {
String binPath = FileUtil.getAppPath(getClass());
String binPath = FileUtil2.getAppPath(getClass());
if(binPath.endsWith("bin")){
binPath = binPath.substring(0, binPath.length() - 3);
}else{
String defaultSavePath = mainWindow.setting.getDefaultSaveDir();
FileUtil.ifNotExistsThenCreate(defaultSavePath);
FileUtil2.ifNotExistsThenCreate(defaultSavePath);
File f = new File(defaultSavePath);
binPath = f.getAbsolutePath().replaceAll(defaultSavePath, "");
}
Expand Down
6 changes: 3 additions & 3 deletions src/org/arong/egdownloader/ui/menuitem/OpenRootMenuItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import org.arong.egdownloader.ui.IconManager;
import org.arong.egdownloader.ui.window.EgDownloaderWindow;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.arong.util.Tracker;
/**
* 打开根目录
Expand All @@ -28,12 +28,12 @@ public OpenRootMenuItem(String text, final EgDownloaderWindow window){
this.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
try {
String binPath = FileUtil.getAppPath(getClass());
String binPath = FileUtil2.getAppPath(getClass());
if(binPath.endsWith("bin")){
binPath = binPath.substring(0, binPath.length() - 3);
}else{
String defaultSavePath = window.setting.getDefaultSaveDir();
FileUtil.ifNotExistsThenCreate(defaultSavePath);
FileUtil2.ifNotExistsThenCreate(defaultSavePath);
File f = new File(defaultSavePath);
binPath = f.getAbsolutePath().replaceAll(defaultSavePath, "");
}
Expand Down
6 changes: 3 additions & 3 deletions src/org/arong/egdownloader/ui/panel/SearchImagePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.arong.egdownloader.ui.IconManager;
import org.arong.egdownloader.ui.popmenu.SearchWindowPopMenu;
import org.arong.egdownloader.ui.window.EgDownloaderWindow;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;

public class SearchImagePanel extends JLabel {
private EgDownloaderWindow mainWindow;
Expand Down Expand Up @@ -67,7 +67,7 @@ public void mouseEntered(MouseEvent e) {
JLabel l = (JLabel) e.getSource();
l.setBorder(BorderFactory.createLineBorder(Color.PINK, 2));
l.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
if(l.getIcon().getIconWidth() == DEFAULTWIDTH && new File(ComponentConst.CACHE_PATH + "/" + FileUtil.filterDir(mainWindow.searchComicWindow.searchTasks.get(Integer.parseInt(l.getName()) - 1).getUrl())).exists()){
if(l.getIcon().getIconWidth() == DEFAULTWIDTH && new File(ComponentConst.CACHE_PATH + "/" + FileUtil2.filterDir(mainWindow.searchComicWindow.searchTasks.get(Integer.parseInt(l.getName()) - 1).getUrl())).exists()){
flush(mainWindow.searchComicWindow.searchTasks.get(Integer.parseInt(l.getName()) - 1));
}
}
Expand Down Expand Up @@ -99,7 +99,7 @@ public void flush(SearchTask task, final long delay){
this.setToolTipText(task.getName() + (StringUtils.isNotBlank(task.getUploader()) ? "[" + task.getUploader() + "]" : ""));
final SearchImagePanel this_ = this;

final String path = ComponentConst.CACHE_PATH + "/" + FileUtil.filterDir(task.getUrl());
final String path = ComponentConst.CACHE_PATH + "/" + FileUtil2.filterDir(task.getUrl());
File cover = new File(path);
if(cover == null || !cover.exists()){
this.setSize(DEFAULTWIDTH, DEFAULTHEIGHT);
Expand Down
6 changes: 3 additions & 3 deletions src/org/arong/egdownloader/ui/panel/TaskInfoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.arong.egdownloader.ui.swing.AJTextPane;
import org.arong.egdownloader.ui.window.EgDownloaderWindow;
import org.arong.egdownloader.ui.window.SearchComicWindow;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;

public class TaskInfoPanel extends JScrollPane {

Expand Down Expand Up @@ -91,8 +91,8 @@ public void parseTask(Task t, int index){
.replace("@t_createTime", t.getCreateTime() == null ? "" : t.getCreateTime())
.replace("@t_completedTime", t.getCompletedTime() == null ? "" : t.getCompletedTime())
.replace("@t_current", t.getCurrent() + "")
.replace("@t_ocurrentSize", FileUtil.showSizeStr(size))
.replace("@t_onepsize", t.getCurrent() == 0 ? "0B" : FileUtil.showSizeStr(size / t.getCurrent()))
.replace("@t_ocurrentSize", FileUtil2.showSizeStr(size))
.replace("@t_onepsize", t.getCurrent() == 0 ? "0B" : FileUtil2.showSizeStr(size / t.getCurrent()))
.replace("@t_ocurrentrate", getSchedule(t.getCurrent(), t.getTotal()))
.replace("@t_start", t.getStart() + "")
.replace("@t_end", t.getEnd() + "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.arong.egdownloader.ui.window.SimpleSearchWindow;
import org.arong.egdownloader.ui.window.form.AddFormDialog;
import org.arong.egdownloader.ui.work.interfaces.IMenuListenerTask;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;

public class SearchWindowPopMenu extends JPopupMenu {
public EgDownloaderWindow mainWindow;
Expand Down Expand Up @@ -154,7 +154,7 @@ public void doWork(Window window, ActionEvent e) {
public void doWork(Window window, ActionEvent e) {
EgDownloaderWindow mainWindow = (EgDownloaderWindow) window;
SearchTask task = mainWindow.searchComicWindow.searchTasks.get(mainWindow.searchComicWindow.selectTaskIndex);
String path = ComponentConst.CACHE_PATH + "/" + FileUtil.filterDir(task.getUrl());
String path = ComponentConst.CACHE_PATH + "/" + FileUtil2.filterDir(task.getUrl());
File coverFile = new File(path);
if(coverFile.exists()){
coverFile.delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.arong.egdownloader.ui.IconManager;
import org.arong.egdownloader.ui.swing.AJButton;
import org.arong.egdownloader.ui.swing.AJLabel;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
/**
* 图片表格单元格渲染器
* @author 阿荣
Expand Down Expand Up @@ -53,7 +53,7 @@ public Component getTableCellRendererComponent(JTable table, Object value,
TableColumn tc = table.getColumnModel().getColumn(column);
tc.setPreferredWidth(80);
tc.setMaxWidth(120);
val = FileUtil.showSizeStr(Long.parseLong(val));
val = FileUtil2.showSizeStr(Long.parseLong(val));
}else if(column == 4){//分别率
TableColumn tc = table.getColumnModel().getColumn(column);
tc.setPreferredWidth(80);
Expand Down
6 changes: 3 additions & 3 deletions src/org/arong/egdownloader/ui/window/AboutMenuWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.arong.egdownloader.ui.swing.AJTextPane;
import org.arong.egdownloader.ui.work.JarUpdateWorker;
import org.arong.egdownloader.version.Version;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;
import org.arong.util.JsonUtil;

/**
Expand Down Expand Up @@ -115,12 +115,12 @@ public void checkVersion(){
}
}else if(! Version.JARVERSION.equals(version.get("jarVersion")) && StringUtils.isNotBlank(version.get("jarUrl"))){

String binPath = FileUtil.getAppPath(getClass());
String binPath = FileUtil2.getAppPath(getClass());
if(binPath.endsWith("bin")){
binPath = binPath.substring(0, binPath.length() - 3);
}else{
String defaultSavePath = mainWindow.setting.getDefaultSaveDir();
FileUtil.ifNotExistsThenCreate(defaultSavePath);
FileUtil2.ifNotExistsThenCreate(defaultSavePath);
File f = new File(defaultSavePath);
binPath = f.getAbsolutePath().replaceAll(defaultSavePath, "");
}
Expand Down
14 changes: 7 additions & 7 deletions src/org/arong/egdownloader/ui/window/EgDownloaderWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
import org.arong.egdownloader.ui.work.listenerWork.StartTaskWork;
import org.arong.egdownloader.ui.work.listenerWork.StopTaskWork;
import org.arong.egdownloader.version.Version;
import org.arong.util.FileUtil;
import org.arong.util.FileUtil2;

/**
* 主线程类
Expand Down Expand Up @@ -139,14 +139,14 @@ private void setupNetSpeedtimer(final EgDownloaderWindow mainWindow){
TimerTask timerTask = new TimerTask() {
public void run() {
//当前一秒内的流量
Long length = FileUtil.byteLength - FileUtil.oldByteLength;
Long length = FileUtil2.byteLength - FileUtil2.oldByteLength;
//显示到标题栏
mainWindow.setTitle(mainWindow.wtitle + " (" + FileUtil.showSizeStr(length) + "/S)");
if(FileUtil.byteLength > 999900000){
FileUtil.byteLength = 0L;
FileUtil.oldByteLength = 0L;
mainWindow.setTitle(mainWindow.wtitle + " (" + FileUtil2.showSizeStr(length) + "/S)");
if(FileUtil2.byteLength > 999900000){
FileUtil2.byteLength = 0L;
FileUtil2.oldByteLength = 0L;
}else{
FileUtil.oldByteLength = FileUtil.byteLength;
FileUtil2.oldByteLength = FileUtil2.byteLength;
}
}
};
Expand Down
Loading

0 comments on commit 810a509

Please sign in to comment.