mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-13 22:54:49 -04:00
Add Split and Merge functions to CLI
Create CanellableRunnable abstraction Change Split/Merge implementation to CanellableRunnable
This commit is contained in:
parent
3592c9086b
commit
dbb7c8e2e1
19 changed files with 358 additions and 65 deletions
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
package nsusbloader.COM.NET;
|
||||
|
||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||
import nsusbloader.ModelControllers.ILogPrinter;
|
||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||
import nsusbloader.ModelControllers.Log;
|
||||
|
@ -31,7 +32,7 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
public class NETCommunications implements Runnable {
|
||||
public class NETCommunications extends CancellableRunnable {
|
||||
|
||||
private final ILogPrinter logPrinter;
|
||||
|
||||
|
@ -84,7 +85,7 @@ public class NETCommunications implements Runnable {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
if (! isValid || Thread.interrupted() )
|
||||
if (! isValid || isCancelled() )
|
||||
return;
|
||||
|
||||
logPrinter.print("\tStart chain", EMsgType.INFO);
|
||||
|
@ -175,7 +176,7 @@ public class NETCommunications implements Runnable {
|
|||
}
|
||||
}
|
||||
catch (Exception e){
|
||||
if (Thread.interrupted())
|
||||
if (isCancelled())
|
||||
logPrinter.print("Interrupted by user.", EMsgType.INFO);
|
||||
else
|
||||
logPrinter.print(e.getMessage(), EMsgType.INFO);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue