Cosmetic naming update; removing useless comments.
This commit is contained in:
parent
5838fe3b89
commit
3bfc37a24e
8 changed files with 39 additions and 31 deletions
|
@ -55,34 +55,34 @@ public class CommandLineInterface {
|
|||
}
|
||||
if (cli.hasOption("n") || cli.hasOption("tfn")){
|
||||
final String[] arguments = cli.getOptionValues("tfn");
|
||||
new TinfoilNet(arguments);
|
||||
new TinfoilNetCli(arguments);
|
||||
return;
|
||||
}
|
||||
if (cli.hasOption("t") || cli.hasOption("tinfoil")){
|
||||
final String[] arguments = cli.getOptionValues("tinfoil");
|
||||
new TinfoilUsb(arguments);
|
||||
new TinfoilUsbCli(arguments);
|
||||
return;
|
||||
}
|
||||
if (cli.hasOption("g") || cli.hasOption("goldleaf")){
|
||||
final String[] arguments = cli.getOptionValues("goldleaf");
|
||||
new GoldLeaf(arguments);
|
||||
new GoldLeafCli(arguments);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
if (cli.hasOption("x") || cli.hasOption("nxdt")){
|
||||
final String[] arguments = cli.getOptionValues("nxdt");
|
||||
new NXDT(arguments);
|
||||
new NxdtCli(arguments);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
if (cli.hasOption("s") || cli.hasOption("split")){
|
||||
final String[] arguments = cli.getOptionValues("split");
|
||||
new Split(arguments);
|
||||
new SplitCli(arguments);
|
||||
return;
|
||||
}
|
||||
if (cli.hasOption("m") || cli.hasOption("merge")){
|
||||
final String[] arguments = cli.getOptionValues("merge");
|
||||
new Merge(arguments);
|
||||
new MergeCli(arguments);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GoldLeaf {
|
||||
public class GoldLeafCli {
|
||||
|
||||
private final String[] arguments;
|
||||
private List<File> filesList;
|
||||
|
@ -34,7 +34,7 @@ public class GoldLeaf {
|
|||
|
||||
private int parseFileSince = 1;
|
||||
|
||||
public GoldLeaf(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
public GoldLeafCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
this.arguments = arguments;
|
||||
|
||||
checkArguments();
|
|
@ -25,13 +25,13 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Merge {
|
||||
public class MergeCli {
|
||||
|
||||
private String[] arguments;
|
||||
private String saveTo;
|
||||
private String[] splitFiles;
|
||||
|
||||
Merge(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
MergeCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
this.arguments = arguments;
|
||||
checkArguments();
|
||||
parseArguments();
|
|
@ -22,12 +22,12 @@ import nsusbloader.Utilities.nxdumptool.NxdtTask;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
public class NXDT {
|
||||
public class NxdtCli {
|
||||
|
||||
private final String[] arguments;
|
||||
private String saveTo;
|
||||
|
||||
public NXDT(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
public NxdtCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
this.arguments = arguments;
|
||||
parseArgument();
|
||||
runBackend();
|
|
@ -1,5 +1,25 @@
|
|||
/*
|
||||
Copyright 2019-2020 Dmitry Isaenko
|
||||
|
||||
This file is part of NS-USBloader.
|
||||
|
||||
NS-USBloader is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
NS-USBloader is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package nsusbloader.cli;
|
||||
|
||||
import nsusbloader.Utilities.Rcm;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class RcmCli {
|
||||
|
@ -8,19 +28,7 @@ public class RcmCli {
|
|||
}
|
||||
|
||||
private void runBackend(String payload) throws InterruptedException{
|
||||
/*
|
||||
boolean isWindows = System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows");
|
||||
|
||||
if (isWindows) {
|
||||
if (! payload.matches("^.:\\\\.*$"))
|
||||
payload = System.getProperty("user.dir") + File.separator + payload;
|
||||
}
|
||||
else {
|
||||
if (! payload.startsWith("/"))
|
||||
payload = System.getProperty("user.dir") + File.separator + payload;
|
||||
}
|
||||
*/
|
||||
nsusbloader.Utilities.Rcm rcm = new nsusbloader.Utilities.Rcm(payload);
|
||||
Rcm rcm = new nsusbloader.Utilities.Rcm(payload);
|
||||
Thread rcmThread = new Thread(rcm);
|
||||
rcmThread.start();
|
||||
rcmThread.join();
|
||||
|
|
|
@ -25,13 +25,13 @@ import java.nio.file.Paths;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Split {
|
||||
public class SplitCli {
|
||||
|
||||
private String[] arguments;
|
||||
private String saveTo;
|
||||
private String[] files;
|
||||
|
||||
Split(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
SplitCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
this.arguments = arguments;
|
||||
checkArguments();
|
||||
parseArguments();
|
|
@ -24,7 +24,7 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TinfoilNet {
|
||||
public class TinfoilNetCli {
|
||||
|
||||
private final String[] arguments;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class TinfoilNet {
|
|||
|
||||
private List<File> filesList;
|
||||
|
||||
TinfoilNet(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
TinfoilNetCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
this.arguments = arguments;
|
||||
checkArguments();
|
||||
parseNsIP();
|
|
@ -24,12 +24,12 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TinfoilUsb {
|
||||
public class TinfoilUsbCli {
|
||||
|
||||
private final String[] arguments;
|
||||
private List<File> filesList;
|
||||
|
||||
public TinfoilUsb(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
public TinfoilUsbCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||
this.arguments = arguments;
|
||||
checkArguments();
|
||||
parseFilesArguments();
|
Loading…
Reference in a new issue