mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-28 04:20:19 +02:00
6.52
-LOGGER fix
This commit is contained in:
parent
d62b8c3918
commit
dd0e7a4973
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.tonikelope</groupId>
|
||||
<artifactId>MegaBasterd</artifactId>
|
||||
<version>6.51</version>
|
||||
<version>6.52</version>
|
||||
<packaging>jar</packaging>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -21,6 +21,7 @@ import java.util.logging.Logger;
|
||||
public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
public static final double SLOW_PROXY_PERC = 0.3;
|
||||
private static final Logger LOG = Logger.getLogger(ChunkDownloader.class.getName());
|
||||
private final boolean FORCE_SMART_PROXY = false; //True for debugging SmartProxy
|
||||
private final int _id;
|
||||
private final Download _download;
|
||||
@ -101,7 +102,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: let''s do some work!", new Object[]{Thread.currentThread().getName(), _id});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: let''s do some work! {2}", new Object[]{Thread.currentThread().getName(), _id, _download.getFile_name()});
|
||||
|
||||
HttpURLConnection con;
|
||||
|
||||
@ -161,7 +162,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
_current_smart_proxy = proxy_manager.getFastestProxy();
|
||||
|
||||
Logger.getLogger(MiscTools.class.getName()).log(Level.WARNING, "{0}: worker {1} excluding proxy -> {2}", new Object[]{Thread.currentThread().getName(), _id, _current_smart_proxy});
|
||||
Logger.getLogger(MiscTools.class.getName()).log(Level.WARNING, "{0}: worker {1} excluding proxy -> {2} {3}", new Object[]{Thread.currentThread().getName(), _id, _current_smart_proxy, _download.getFile_name()});
|
||||
|
||||
} else if (_current_smart_proxy == null) {
|
||||
|
||||
@ -187,7 +188,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
} else {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] SmartProxy getFastestProxy returned NULL!", new Object[]{Thread.currentThread().getName(), _id});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] SmartProxy getFastestProxy returned NULL! {2}", new Object[]{Thread.currentThread().getName(), _id, _download.getFile_name()});
|
||||
|
||||
URL url = new URL(chunk_url);
|
||||
|
||||
@ -237,7 +238,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
File tmp_chunk_file = null, chunk_file = null;
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] is downloading chunk [{2}]!", new Object[]{Thread.currentThread().getName(), _id, chunk_id});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] is downloading chunk [{2}]! {3}", new Object[]{Thread.currentThread().getName(), _id, chunk_id, _download.getFile_name()});
|
||||
|
||||
try {
|
||||
|
||||
@ -247,7 +248,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (http_status != 200) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] Failed chunk download : HTTP error code : {2}", new Object[]{Thread.currentThread().getName(), _id, http_status});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] Failed chunk download : HTTP error code : {2} {3}", new Object[]{Thread.currentThread().getName(), _id, http_status, _download.getFile_name()});
|
||||
|
||||
http_error = http_status;
|
||||
|
||||
@ -296,7 +297,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
} else {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] has RECOVERED PREVIOUS chunk [{2}]!", new Object[]{Thread.currentThread().getName(), _id, chunk_id});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] has RECOVERED PREVIOUS chunk [{2}]! {3}", new Object[]{Thread.currentThread().getName(), _id, chunk_id, _download.getFile_name()});
|
||||
|
||||
finish_chunk_time = -1;
|
||||
|
||||
@ -311,7 +312,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (chunk_reads == chunk_size) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] has DOWNLOADED chunk [{2}]!", new Object[]{Thread.currentThread().getName(), _id, chunk_id});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] has DOWNLOADED chunk [{2}]! {3}", new Object[]{Thread.currentThread().getName(), _id, chunk_id, _download.getFile_name()});
|
||||
|
||||
if (tmp_chunk_file != null && chunk_file != null && (!chunk_file.exists() || chunk_file.length() != chunk_size)) {
|
||||
|
||||
@ -342,7 +343,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (chunk_speed < Math.round(avg_chunk_speed * SLOW_PROXY_PERC)) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] WARNING -> PROXY {2} CHUNK DOWNLOAD SPEED: {3}/s SEEMS TO BE SLOW (average is {4}/s)", new Object[]{Thread.currentThread().getName(), _id, _current_smart_proxy, formatBytes(chunk_speed), formatBytes(avg_chunk_speed)});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] WARNING -> PROXY {2} CHUNK DOWNLOAD SPEED: {3}/s SEEMS TO BE SLOW (average is {4}/s) {4}", new Object[]{Thread.currentThread().getName(), _id, _current_smart_proxy, formatBytes(chunk_speed), formatBytes(avg_chunk_speed), _download.getFile_name()});
|
||||
|
||||
slow_proxy = true;
|
||||
}
|
||||
@ -369,11 +370,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (chunk_error) {
|
||||
|
||||
if (!_exit && !_download.isStopped()) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] has FAILED downloading chunk [{2}]!", new Object[]{Thread.currentThread().getName(), _id, chunk_id});
|
||||
|
||||
}
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}] has FAILED downloading chunk [{2}]! {3}", new Object[]{Thread.currentThread().getName(), _id, chunk_id, _download.getFile_name()});
|
||||
|
||||
if (tmp_chunk_file != null && tmp_chunk_file.exists()) {
|
||||
tmp_chunk_file.delete();
|
||||
@ -421,7 +418,6 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
_download.getChunkmanager().secureNotify();
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: bye bye", new Object[]{Thread.currentThread().getName(), _id});
|
||||
LOG.log(Level.INFO, "{0} ChunkDownloader [{1}] {2}: bye bye", new Object[]{Thread.currentThread().getName(), _id, _download.getFile_name()});
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ChunkDownloader.class.getName());
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ import javax.crypto.CipherInputStream;
|
||||
*/
|
||||
public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ChunkDownloaderMono.class.getName());
|
||||
|
||||
public ChunkDownloaderMono(Download download) {
|
||||
super(1, download);
|
||||
}
|
||||
@ -27,7 +29,7 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: let''s do some work!", new Object[]{Thread.currentThread().getName(), getId()});
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: let''s do some work! {2}", new Object[]{Thread.currentThread().getName(), getId(), getDownload().getFile_name()});
|
||||
|
||||
HttpURLConnection con = null;
|
||||
|
||||
@ -99,7 +101,7 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
|
||||
if (http_status != 200) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Failed : HTTP error code : {1}", new Object[]{Thread.currentThread().getName(), http_status});
|
||||
LOG.log(Level.INFO, "{0} Failed : HTTP error code : {1} {2}", new Object[]{Thread.currentThread().getName(), http_status, getDownload().getFile_name()});
|
||||
|
||||
http_error = http_status;
|
||||
|
||||
@ -209,8 +211,7 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
|
||||
getDownload().secureNotify();
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: bye bye", new Object[]{Thread.currentThread().getName(), getId()});
|
||||
LOG.log(Level.INFO, "{0} ChunkDownloaderMONO {1}: bye bye", new Object[]{Thread.currentThread().getName(), getDownload().getFile_name()});
|
||||
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ChunkDownloaderMono.class.getName());
|
||||
}
|
||||
|
@ -8,9 +8,10 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class ChunkInvalidException extends Exception {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ChunkInvalidException.class.getName());
|
||||
|
||||
public ChunkInvalidException(String message) {
|
||||
super(message);
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ChunkInvalidException.class.getName());
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import javax.crypto.CipherInputStream;
|
||||
public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
public static final int MAX_CHUNK_ERROR = 100;
|
||||
private static final Logger LOG = Logger.getLogger(ChunkUploader.class.getName());
|
||||
private final int _id;
|
||||
private final Upload _upload;
|
||||
private volatile boolean _exit;
|
||||
@ -94,7 +95,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
LOG.log(Level.INFO, "{0} ChunkUploader {1} hello! {2}", new Object[]{Thread.currentThread().getName(), getId(), getUpload().getFile_name()});
|
||||
LOG.log(Level.INFO, "{0} ChunkUploader {1} hello! {2}", new Object[]{Thread.currentThread().getName(), getId(), _upload.getFile_name()});
|
||||
|
||||
long chunk_id = 0;
|
||||
|
||||
@ -177,7 +178,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
try (CipherInputStream cis = new CipherInputStream(new BufferedInputStream(Channels.newInputStream(f.getChannel())), genCrypter("AES", "AES/CTR/NoPadding", _upload.getByte_file_key(), forwardMEGALinkKeyIV(_upload.getByte_file_iv(), chunk_offset))); OutputStream out = new ThrottledOutputStream(con.getOutputStream(), _upload.getMain_panel().getStream_supervisor())) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Uploading chunk {1} from worker {2}...", new Object[]{Thread.currentThread().getName(), chunk_id, _id});
|
||||
LOG.log(Level.INFO, "{0} Uploading chunk {1} from worker {2} {3}...", new Object[]{Thread.currentThread().getName(), chunk_id, _id, _upload.getFile_name()});
|
||||
|
||||
while (!_exit && !_upload.isStopped() && tot_bytes_up < chunk_size && (reads = cis.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, reads);
|
||||
@ -202,12 +203,12 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if ((http_status = con.getResponseCode()) != 200) {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker {1} Failed : HTTP error code : {2}", new Object[]{Thread.currentThread().getName(), _id, http_status});
|
||||
LOG.log(Level.INFO, "{0} Worker {1} Failed : HTTP error code : {2} {3}", new Object[]{Thread.currentThread().getName(), _id, http_status, _upload.getFile_name()});
|
||||
|
||||
} else if (tot_bytes_up == chunk_size || reads == -1) {
|
||||
|
||||
if (_upload.getProgress() == _upload.getFile_size() && _upload.getCompletion_handler() == null) {
|
||||
LOG.log(Level.INFO, "{0} Worker {1} waiting for completion handler...", new Object[]{Thread.currentThread().getName(), _id});
|
||||
LOG.log(Level.INFO, "{0} Worker {1} {2} waiting for completion handler...", new Object[]{Thread.currentThread().getName(), _id, _upload.getFile_name()});
|
||||
_upload.getView().printStatusNormal("Waiting for completion handler ... ***DO NOT EXIT MEGABASTERD NOW***");
|
||||
_upload.getView().updateProgressBar(Integer.MAX_VALUE);
|
||||
}
|
||||
@ -229,13 +230,13 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (MegaAPI.checkMEGAError(httpresponse) != 0) {
|
||||
|
||||
LOG.log(Level.WARNING, "{0} Worker {1} UPLOAD FAILED! (MEGA ERROR: {2})", new Object[]{Thread.currentThread().getName(), _id, MegaAPI.checkMEGAError(httpresponse)});
|
||||
LOG.log(Level.WARNING, "{0} Worker {1} UPLOAD FAILED! (MEGA ERROR: {2}) {3}", new Object[]{Thread.currentThread().getName(), _id, MegaAPI.checkMEGAError(httpresponse), _upload.getFile_name()});
|
||||
|
||||
fatal_error = true;
|
||||
|
||||
} else {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker {1} Completion handler -> {2}", new Object[]{Thread.currentThread().getName(), _id, httpresponse});
|
||||
LOG.log(Level.INFO, "{0} Worker {1} Completion handler -> {2} {3}", new Object[]{Thread.currentThread().getName(), _id, httpresponse, _upload.getFile_name()});
|
||||
|
||||
_upload.setCompletion_handler(httpresponse);
|
||||
|
||||
@ -263,7 +264,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (chunk_error) {
|
||||
|
||||
LOG.log(Level.WARNING, "{0} Uploading chunk {1} from worker {2} FAILED!...", new Object[]{Thread.currentThread().getName(), chunk_id, _id});
|
||||
LOG.log(Level.WARNING, "{0} Uploading chunk {1} from worker {2} FAILED! {3}...", new Object[]{Thread.currentThread().getName(), chunk_id, _id, _upload.getFile_name()});
|
||||
|
||||
_upload.rejectChunkId(chunk_id);
|
||||
|
||||
@ -278,13 +279,13 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
_upload.stopUploader("UPLOAD FAILED: FATAL ERROR");
|
||||
|
||||
LOG.log(Level.SEVERE, "UPLOAD FAILED: FATAL ERROR");
|
||||
LOG.log(Level.SEVERE, "UPLOAD FAILED: FATAL ERROR {0}", new Object[]{_upload.getFile_name()});
|
||||
|
||||
} else if (++conta_error == MAX_CHUNK_ERROR) {
|
||||
|
||||
_upload.stopUploader("UPLOAD FAILED: too many errors");
|
||||
|
||||
LOG.log(Level.SEVERE, "UPLOAD FAILED: too many errors");
|
||||
LOG.log(Level.SEVERE, "UPLOAD FAILED: too many errors {0}", new Object[]{_upload.getFile_name()});
|
||||
|
||||
} else if (!_exit && !_upload.isStopped()) {
|
||||
|
||||
@ -306,7 +307,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
} else {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker {1} has uploaded chunk {2}", new Object[]{Thread.currentThread().getName(), _id, chunk_id});
|
||||
LOG.log(Level.INFO, "{0} Worker {1} has uploaded chunk {2} {3}", new Object[]{Thread.currentThread().getName(), _id, chunk_id, _upload.getFile_name()});
|
||||
|
||||
conta_error = 0;
|
||||
}
|
||||
@ -327,9 +328,8 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
_upload.getMac_generator().secureNotify();
|
||||
|
||||
LOG.log(Level.INFO, "{0} ChunkUploader {1} bye bye...", new Object[]{Thread.currentThread().getName(), _id});
|
||||
LOG.log(Level.INFO, "{0} ChunkUploader [{1}] {2} bye bye...", new Object[]{Thread.currentThread().getName(), _id, _upload.getFile_name()});
|
||||
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ChunkUploader.class.getName());
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ import javax.crypto.NoSuchPaddingException;
|
||||
*/
|
||||
public final class ChunkWriteManager implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ChunkWriteManager.class.getName());
|
||||
|
||||
public static long calculateChunkOffset(long chunk_id, int size_multi) {
|
||||
long[] offs = {0, 128, 384, 768, 1280, 1920, 2688};
|
||||
|
||||
@ -225,8 +227,7 @@ public final class ChunkWriteManager implements Runnable, SecureSingleThreadNoti
|
||||
|
||||
_download.secureNotify();
|
||||
|
||||
LOG.log(Level.INFO, "{0} Chunkmanager: bye bye{1}", new Object[]{Thread.currentThread().getName(), _download.getFile().getName()});
|
||||
LOG.log(Level.INFO, "{0} Chunkmanager: bye bye{1}", new Object[]{Thread.currentThread().getName(), _download.getFile_name()});
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ChunkWriteManager.class.getName());
|
||||
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import java.util.logging.Logger;
|
||||
public final class ClipboardSpy implements Runnable, ClipboardOwner, SecureSingleThreadNotifiable, ClipboardChangeObservable {
|
||||
|
||||
private static final int SLEEP = 250;
|
||||
private static final Logger LOG = Logger.getLogger(ClipboardSpy.class.getName());
|
||||
|
||||
private final Clipboard _sysClip;
|
||||
|
||||
@ -200,6 +201,5 @@ public final class ClipboardSpy implements Runnable, ClipboardOwner, SecureSingl
|
||||
o.notifyClipboardChange();
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ClipboardSpy.class.getName());
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class ContentType {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ContentType.class.getName());
|
||||
|
||||
private final HashMap<String, String> _content_type;
|
||||
|
||||
public ContentType() {
|
||||
@ -60,5 +62,4 @@ public final class ContentType {
|
||||
public String getMIME(String ext) {
|
||||
return _content_type.get(ext);
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ContentType.class.getName());
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ import javax.swing.text.JTextComponent;
|
||||
*/
|
||||
public final class ContextMenuMouseListener extends MouseAdapter {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ContextMenuMouseListener.class.getName());
|
||||
|
||||
private final JPopupMenu _popup;
|
||||
private final Action _cutAction;
|
||||
private final Action _copyAction;
|
||||
@ -128,5 +130,4 @@ public final class ContextMenuMouseListener extends MouseAdapter {
|
||||
private enum _Actions {
|
||||
UNDO, CUT, COPY, PASTE, SELECT_ALL
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ContextMenuMouseListener.class.getName());
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ public final class CryptTools {
|
||||
public static final int MASTER_PASSWORD_PBKDF2_OUTPUT_BIT_LENGTH = 256;
|
||||
|
||||
public static final int MASTER_PASSWORD_PBKDF2_ITERATIONS = 65536;
|
||||
private static final Logger LOG = Logger.getLogger(CryptTools.class.getName());
|
||||
|
||||
public static Cipher genDecrypter(String algo, String mode, byte[] key, byte[] iv) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException {
|
||||
SecretKeySpec skeySpec = new SecretKeySpec(key, algo);
|
||||
@ -663,5 +664,4 @@ public final class CryptTools {
|
||||
|
||||
private CryptTools() {
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(CryptTools.class.getName());
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class DBTools {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DBTools.class.getName());
|
||||
|
||||
public static synchronized void setupSqliteTables() throws SQLException {
|
||||
|
||||
try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) {
|
||||
@ -514,6 +516,5 @@ public final class DBTools {
|
||||
|
||||
private DBTools() {
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(DBTools.class.getName());
|
||||
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
public static final int WORKERS_DEFAULT = 6;
|
||||
public static final boolean USE_MEGA_ACCOUNT_DOWN = false;
|
||||
public static final int CHUNK_SIZE_MULTI = 10;
|
||||
private static final Logger LOG = Logger.getLogger(Download.class.getName());
|
||||
|
||||
private final MainPanel _main_panel;
|
||||
private volatile DownloadView _view;
|
||||
@ -308,10 +309,6 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
return _output_stream;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
public ArrayList<ChunkDownloader> getChunkworkers() {
|
||||
|
||||
synchronized (_workers_lock) {
|
||||
@ -1732,5 +1729,4 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
return _restart;
|
||||
}
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(Download.class.getName());
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class DownloadManager extends TransferenceManager {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DownloadManager.class.getName());
|
||||
|
||||
public DownloadManager(MainPanel main_panel) {
|
||||
|
||||
super(main_panel, main_panel.getMax_dl(), main_panel.getView().getStatus_down_label(), main_panel.getView().getjPanel_scroll_down(), main_panel.getView().getClose_all_finished_down_button(), main_panel.getView().getPause_all_down_button(), main_panel.getView().getClean_all_down_menu());
|
||||
@ -162,6 +164,4 @@ public final class DownloadManager extends TransferenceManager {
|
||||
}
|
||||
}
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DownloadManager.class.getName());
|
||||
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ public final class KissVideoStreamServer implements HttpHandler, SecureSingleThr
|
||||
public static final int THREAD_START = 0x01;
|
||||
public static final int THREAD_STOP = 0x02;
|
||||
public static final int DEFAULT_WORKERS = 10;
|
||||
private static final Logger LOG = Logger.getLogger(KissVideoStreamServer.class.getName());
|
||||
|
||||
private final MainPanel _main_panel;
|
||||
private final ConcurrentHashMap<String, HashMap<String, Object>> _link_cache;
|
||||
@ -485,5 +486,4 @@ public final class KissVideoStreamServer implements HttpHandler, SecureSingleThr
|
||||
|
||||
_updateStatus(THREAD_STOP);
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(KissVideoStreamServer.class.getName());
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class LabelTranslatorSingleton {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(LabelTranslatorSingleton.class.getName());
|
||||
|
||||
public static LabelTranslatorSingleton getInstance() {
|
||||
|
||||
return LabelTranslatorSingleton.LazyHolder.INSTANCE;
|
||||
@ -298,5 +300,4 @@ public final class LabelTranslatorSingleton {
|
||||
|
||||
private static final LabelTranslatorSingleton INSTANCE = new LabelTranslatorSingleton();
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(LabelTranslatorSingleton.class.getName());
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ import javax.swing.UIManager;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "6.51";
|
||||
public static final String VERSION = "6.52";
|
||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
||||
public static final int STREAMER_PORT = 1337;
|
||||
@ -75,6 +75,7 @@ public final class MainPanel {
|
||||
private static SmartMegaProxyManager _proxy_manager;
|
||||
private static String _language;
|
||||
private static String _new_version;
|
||||
private static final Logger LOG = Logger.getLogger(MainPanel.class.getName());
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
@ -1381,6 +1382,5 @@ public final class MainPanel {
|
||||
});
|
||||
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MainPanel.class.getName());
|
||||
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public final class MegaAPI implements Serializable {
|
||||
public static final Integer[] MEGA_ERROR_EXCEPTION_CODES = {-2, -5, -6, -8, -9, -10, -11, -12, -13, -14, -15, -16, -26};
|
||||
public static final int PBKDF2_ITERATIONS = 100000;
|
||||
public static final int PBKDF2_OUTPUT_BIT_LENGTH = 256;
|
||||
private static final Logger LOG = Logger.getLogger(MegaAPI.class.getName());
|
||||
|
||||
public static int checkMEGAError(String data) {
|
||||
String error = findFirstRegex("^\\[?(\\-[0-9]+)\\]?$", data, 1);
|
||||
@ -971,6 +972,5 @@ public final class MegaAPI implements Serializable {
|
||||
|
||||
return null;
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MegaAPI.class.getName());
|
||||
|
||||
}
|
||||
|
@ -8,9 +8,10 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class MegaAPIException extends APIException {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(MegaAPIException.class.getName());
|
||||
|
||||
public MegaAPIException(int code) {
|
||||
super(code, "MEGA API ERROR: " + String.valueOf(code));
|
||||
_code = code;
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MegaAPIException.class.getName());
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ public final class MegaCrypterAPI {
|
||||
|
||||
public static final Set<String> PASS_CACHE = new HashSet<>();
|
||||
public static final Object PASS_LOCK = new Object();
|
||||
private static final Logger LOG = Logger.getLogger(MegaCrypterAPI.class.getName());
|
||||
|
||||
private static String _rawRequest(String request, URL url_api) throws MegaCrypterAPIException {
|
||||
|
||||
@ -327,5 +328,4 @@ public final class MegaCrypterAPI {
|
||||
|
||||
private MegaCrypterAPI() {
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MegaCrypterAPI.class.getName());
|
||||
}
|
||||
|
@ -8,9 +8,10 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class MegaCrypterAPIException extends APIException {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(MegaCrypterAPIException.class.getName());
|
||||
|
||||
public MegaCrypterAPIException(int code) {
|
||||
super(code, "MEGACRYPTER API ERROR: " + String.valueOf(code));
|
||||
_code = code;
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MegaCrypterAPIException.class.getName());
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class MegaDirNode {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(MegaDirNode.class.getName());
|
||||
|
||||
private final String _node_id;
|
||||
|
||||
private final HashMap<String, MegaDirNode> _children;
|
||||
@ -27,6 +29,5 @@ public final class MegaDirNode {
|
||||
public HashMap<String, MegaDirNode> getChildren() {
|
||||
return _children;
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MegaDirNode.class.getName());
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,20 @@ import javax.swing.tree.MutableTreeNode;
|
||||
*/
|
||||
public class MegaMutableTreeNode extends DefaultMutableTreeNode {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(MegaMutableTreeNode.class.getName());
|
||||
protected Comparator nodeComparator = new Comparator() {
|
||||
@Override
|
||||
public int compare(Object o1, Object o2) {
|
||||
return o1.toString().compareToIgnoreCase(o2.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
|
||||
public boolean equals(Object obj) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public MegaMutableTreeNode() {
|
||||
super();
|
||||
}
|
||||
@ -52,18 +66,4 @@ public class MegaMutableTreeNode extends DefaultMutableTreeNode {
|
||||
Collections.sort(this.children, nodeComparator);
|
||||
}
|
||||
|
||||
protected Comparator nodeComparator = new Comparator() {
|
||||
@Override
|
||||
public int compare(Object o1, Object o2) {
|
||||
return o1.toString().compareToIgnoreCase(o2.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
|
||||
public boolean equals(Object obj) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
private static final Logger LOG = Logger.getLogger(MegaMutableTreeNode.class.getName());
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class MegaProxyServer implements Runnable {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(MegaProxyServer.class.getName());
|
||||
|
||||
private final String _password;
|
||||
private final int _port;
|
||||
private ServerSocket _serverSocket;
|
||||
@ -266,5 +268,4 @@ public class MegaProxyServer implements Runnable {
|
||||
return byteArrayOutputStream.toString("UTF-8");
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MegaProxyServer.class.getName());
|
||||
}
|
||||
|
@ -103,6 +103,7 @@ public final class MiscTools {
|
||||
}
|
||||
}
|
||||
};
|
||||
private static final Logger LOG = Logger.getLogger(MiscTools.class.getName());
|
||||
|
||||
public static void deleteDirectoryRecursion(Path path) throws IOException {
|
||||
if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) {
|
||||
@ -1286,6 +1287,5 @@ public final class MiscTools {
|
||||
|
||||
private MiscTools() {
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(MiscTools.class.getName());
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class ProgressMeter implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ProgressMeter.class.getName());
|
||||
|
||||
private final Transference _transference;
|
||||
private volatile boolean _exit;
|
||||
private final Object _secure_notify_lock;
|
||||
@ -58,7 +60,7 @@ public final class ProgressMeter implements Runnable, SecureSingleThreadNotifiab
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
LOG.log(Level.INFO, "{0} ProgressMeter hello!", Thread.currentThread().getName());
|
||||
LOG.log(Level.INFO, "{0} ProgressMeter hello! {1}", new Object[]{Thread.currentThread().getName(), _transference.getFile_name()});
|
||||
|
||||
_progress = _transference.getProgress();
|
||||
|
||||
@ -75,9 +77,8 @@ public final class ProgressMeter implements Runnable, SecureSingleThreadNotifiab
|
||||
}
|
||||
}
|
||||
|
||||
LOG.log(Level.INFO, "{0} ProgressMeter bye bye!", Thread.currentThread().getName());
|
||||
LOG.log(Level.INFO, "{0} ProgressMeter bye bye! {1}", new Object[]{Thread.currentThread().getName(), _transference.getFile_name()});
|
||||
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ProgressMeter.class.getName());
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ public final class SmartMegaProxyManager {
|
||||
|
||||
public static String DEFAULT_SMART_PROXY_URL = "https://raw.githubusercontent.com/tonikelope/megabasterd/proxy_list/proxy_list.txt";
|
||||
public static final int BLOCK_TIME = 180;
|
||||
private static final Logger LOG = Logger.getLogger(SmartMegaProxyManager.class.getName());
|
||||
private volatile String _proxy_list_url;
|
||||
private final LinkedHashMap<String, Long> _proxy_list;
|
||||
private final MainPanel _main_panel;
|
||||
@ -139,6 +140,5 @@ public final class SmartMegaProxyManager {
|
||||
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(SmartMegaProxyManager.class.getName());
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ public final class SpeedMeter implements Runnable {
|
||||
|
||||
public static final int SLEEP = 3000;
|
||||
public static final int CHUNK_SPEED_QUEUE_MAX_SIZE = 10;
|
||||
private static final Logger LOG = Logger.getLogger(SpeedMeter.class.getName());
|
||||
private final JLabel _speed_label;
|
||||
private final JLabel _rem_label;
|
||||
private final TransferenceManager _trans_manager;
|
||||
@ -241,5 +242,4 @@ public final class SpeedMeter implements Runnable {
|
||||
|
||||
} while (true);
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(SpeedMeter.class.getName());
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ public final class SqliteSingleton {
|
||||
public static final String SQLITE_FILE = "megabasterd.db";
|
||||
|
||||
public static final int VALIDATION_TIMEOUT = 15;
|
||||
private static final Logger LOG = Logger.getLogger(SqliteSingleton.class.getName());
|
||||
|
||||
public static SqliteSingleton getInstance() {
|
||||
|
||||
@ -59,6 +60,5 @@ public final class SqliteSingleton {
|
||||
|
||||
private static final SqliteSingleton INSTANCE = new SqliteSingleton();
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(SqliteSingleton.class.getName());
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class StreamChunk {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(StreamChunk.class.getName());
|
||||
|
||||
private final long _offset;
|
||||
private final long _size;
|
||||
private final String _url;
|
||||
@ -72,6 +74,5 @@ public final class StreamChunk {
|
||||
return new ByteArrayInputStream(this.buf, 0, this.count);
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(StreamChunk.class.getName());
|
||||
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class StreamChunkDownloader implements Runnable {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(StreamChunkDownloader.class.getName());
|
||||
|
||||
private final int _id;
|
||||
private final StreamChunkManager _chunkmanager;
|
||||
private volatile boolean _exit;
|
||||
@ -201,6 +203,5 @@ public class StreamChunkDownloader implements Runnable {
|
||||
|
||||
LOG.log(Level.INFO, "{0} Worker [{1}]: bye bye", new Object[]{Thread.currentThread().getName(), _id});
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(StreamChunkDownloader.class.getName());
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ public class StreamChunkManager implements Runnable, SecureMultiThreadNotifiable
|
||||
|
||||
public static final int CHUNK_SIZE = 1048576;
|
||||
public static final int BUFFER_CHUNKS_SIZE = 20;
|
||||
private static final Logger LOG = Logger.getLogger(StreamChunkManager.class.getName());
|
||||
private long _next_offset_required;
|
||||
private long _bytes_written;
|
||||
private final long _start_offset;
|
||||
@ -193,6 +194,5 @@ public class StreamChunkManager implements Runnable, SecureMultiThreadNotifiable
|
||||
_secure_notify_lock.notifyAll();
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(StreamChunkManager.class.getName());
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class StreamThrottlerSupervisor implements Runnable, SecureMultiThreadNotifiable {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(StreamThrottlerSupervisor.class.getName());
|
||||
|
||||
private ConcurrentLinkedQueue<Integer> _input_slice_queue, _output_slice_queue;
|
||||
|
||||
private final int _slice_size;
|
||||
@ -198,6 +200,5 @@ public final class StreamThrottlerSupervisor implements Runnable, SecureMultiThr
|
||||
|
||||
return queue;
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(StreamThrottlerSupervisor.class.getName());
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class ThrottledInputStream extends InputStream {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ThrottledInputStream.class.getName());
|
||||
|
||||
private final InputStream _rawStream;
|
||||
|
||||
private final StreamThrottlerSupervisor _stream_supervisor;
|
||||
@ -171,6 +173,5 @@ public final class ThrottledInputStream extends InputStream {
|
||||
_slice_size = req_slice_size;
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ThrottledInputStream.class.getName());
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class ThrottledOutputStream extends OutputStream {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ThrottledOutputStream.class.getName());
|
||||
|
||||
private final OutputStream _rawStream;
|
||||
|
||||
private final StreamThrottlerSupervisor _stream_supervisor;
|
||||
@ -79,6 +81,5 @@ public final class ThrottledOutputStream extends OutputStream {
|
||||
_slice_size = req_slice_size;
|
||||
}
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(ThrottledOutputStream.class.getName());
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import javax.swing.JPanel;
|
||||
abstract public class TransferenceManager implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
public static final int MAX_WAIT_QUEUE = 1000;
|
||||
private static final Logger LOG = Logger.getLogger(TransferenceManager.class.getName());
|
||||
|
||||
private final ConcurrentLinkedQueue<Object> _transference_preprocess_global_queue;
|
||||
private final ConcurrentLinkedQueue<Runnable> _transference_preprocess_queue;
|
||||
@ -720,6 +721,4 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
|
||||
}
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(TransferenceManager.class.getName());
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ public final class Upload implements Transference, Runnable, SecureSingleThreadN
|
||||
|
||||
public static final int WORKERS_DEFAULT = 6;
|
||||
public static final int CHUNK_SIZE_MULTI = 1; //Otra cosa da errores al reanudar una subida (investigar)
|
||||
private static final Logger LOG = Logger.getLogger(Upload.class.getName());
|
||||
private final MainPanel _main_panel;
|
||||
private volatile UploadView _view;
|
||||
private volatile ProgressMeter _progress_meter;
|
||||
@ -1291,5 +1292,4 @@ public final class Upload implements Transference, Runnable, SecureSingleThreadN
|
||||
_main_panel.getUpload_manager().downWaitQueue(this);
|
||||
}
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(Upload.class.getName());
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ import javax.crypto.IllegalBlockSizeException;
|
||||
*/
|
||||
public final class UploadMACGenerator implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(UploadMACGenerator.class.getName());
|
||||
|
||||
private final Upload _upload;
|
||||
private final Object _secure_notify_lock;
|
||||
private boolean _notified;
|
||||
@ -75,6 +77,8 @@ public final class UploadMACGenerator implements Runnable, SecureSingleThreadNot
|
||||
|
||||
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
|
||||
|
||||
LOG.log(Level.INFO, "{0} MAC GENERATOR {1} Hello!", new Object[]{Thread.currentThread().getName(), getUpload().getFile_name()});
|
||||
|
||||
try {
|
||||
|
||||
long chunk_id = 1L, tot = 0L;
|
||||
@ -193,7 +197,7 @@ public final class UploadMACGenerator implements Runnable, SecureSingleThreadNot
|
||||
|
||||
_upload.setFile_meta_mac(meta_mac);
|
||||
|
||||
LOG.log(Level.INFO, "{0} MAC GENERATOR {1} finished MAC CALCULATION. Waiting workers to finish uploading (if any)...", new Object[]{Thread.currentThread().getName(), this.getUpload().getFile_name()});
|
||||
LOG.log(Level.INFO, "{0} MAC GENERATOR {1} finished MAC CALCULATION. Waiting workers to finish uploading (if any)...", new Object[]{Thread.currentThread().getName(), getUpload().getFile_name()});
|
||||
|
||||
} else {
|
||||
|
||||
@ -214,13 +218,12 @@ public final class UploadMACGenerator implements Runnable, SecureSingleThreadNot
|
||||
|
||||
_upload.secureNotify();
|
||||
|
||||
LOG.log(Level.INFO, "{0} MAC GENERATOR {1} BYE BYE...", new Object[]{Thread.currentThread().getName(), this.getUpload().getFile_name()});
|
||||
LOG.log(Level.INFO, "{0} MAC GENERATOR {1} BYE BYE...", new Object[]{Thread.currentThread().getName(), getUpload().getFile_name()});
|
||||
|
||||
} catch (Exception ex) {
|
||||
LOG.log(Level.SEVERE, ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(UploadMACGenerator.class.getName());
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class UploadManager extends TransferenceManager {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(UploadManager.class.getName());
|
||||
|
||||
private final ConcurrentLinkedQueue<Upload> _finishing_uploads_queue;
|
||||
|
||||
private final Object _log_file_lock;
|
||||
@ -141,6 +143,5 @@ public final class UploadManager extends TransferenceManager {
|
||||
|
||||
secureNotify();
|
||||
}
|
||||
private static final Logger LOG = Logger.getLogger(UploadManager.class.getName());
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 194 KiB |
Loading…
x
Reference in New Issue
Block a user