Skip to content

Commit 5776c34

Browse files
author
tonikelope
committed
7.55
Multi language fix
1 parent 8a9e327 commit 5776c34

22 files changed

+192
-148
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.tonikelope</groupId>
55
<artifactId>MegaBasterd</artifactId>
6-
<version>7.54</version>
6+
<version>7.55</version>
77
<packaging>jar</packaging>
88
<dependencies>
99
<dependency>

src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public void run() {
293293

294294
tmp_chunk_file = new File(_download.getChunkmanager().getChunks_dir() + "/" + new File(_download.getFile_name()).getName() + ".chunk" + chunk_id + ".tmp");
295295

296-
try (InputStream is = new ThrottledInputStream(con.getInputStream(), _download.getMain_panel().getStream_supervisor()); OutputStream tmp_chunk_file_os = new BufferedOutputStream(new FileOutputStream(tmp_chunk_file))) {
296+
try ( InputStream is = new ThrottledInputStream(con.getInputStream(), _download.getMain_panel().getStream_supervisor()); OutputStream tmp_chunk_file_os = new BufferedOutputStream(new FileOutputStream(tmp_chunk_file))) {
297297

298298
init_chunk_time = System.currentTimeMillis();
299299

src/main/java/com/tonikelope/megabasterd/ChunkUploader.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void run() {
185185

186186
f.seek(chunk_offset);
187187

188-
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())) {
188+
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())) {
189189

190190
LOG.log(Level.INFO, "{0} Uploading chunk {1} from worker {2} {3}...", new Object[]{Thread.currentThread().getName(), chunk_id, _id, _upload.getFile_name()});
191191

@@ -223,7 +223,7 @@ public void run() {
223223

224224
String httpresponse;
225225

226-
try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) {
226+
try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) {
227227

228228
while ((reads = is.read(buffer)) != -1) {
229229
byte_res.write(buffer, 0, reads);

src/main/java/com/tonikelope/megabasterd/ChunkWriterManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void run() {
205205

206206
int reads;
207207

208-
try (CipherInputStream cis = new CipherInputStream(new BufferedInputStream(new FileInputStream(chunk_file)), genDecrypter("AES", "AES/CTR/NoPadding", _byte_file_key, forwardMEGALinkKeyIV(_byte_iv, _bytes_written)))) {
208+
try ( CipherInputStream cis = new CipherInputStream(new BufferedInputStream(new FileInputStream(chunk_file)), genDecrypter("AES", "AES/CTR/NoPadding", _byte_file_key, forwardMEGALinkKeyIV(_byte_iv, _bytes_written)))) {
209209
while ((reads = cis.read(buffer)) != -1) {
210210
_download.getOutput_stream().write(buffer, 0, reads);
211211
}

src/main/java/com/tonikelope/megabasterd/CryptTools.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public static HashSet<String> decryptELC(String link, MainPanel main_panel) {
300300

301301
if (compression) {
302302

303-
try (InputStream is = new GZIPInputStream(new ByteArrayInputStream(elc_byte)); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
303+
try ( InputStream is = new GZIPInputStream(new ByteArrayInputStream(elc_byte)); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
304304

305305
byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE];
306306

@@ -428,7 +428,7 @@ public static HashSet<String> decryptELC(String link, MainPanel main_panel) {
428428

429429
con.getOutputStream().close();
430430

431-
try (InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
431+
try ( InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
432432

433433
byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE];
434434

@@ -549,7 +549,7 @@ public static HashSet<String> decryptDLC(String data, MainPanel main_panel) {
549549

550550
String enc_dlc_key;
551551

552-
try (InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
552+
try ( InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
553553
byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE];
554554
int reads;
555555
while ((reads = is.read(buffer)) != -1) {

0 commit comments

Comments
 (0)