Make it compileable again. Fixed one small issue while copying files.

This commit is contained in:
Maschell 2016-11-14 17:04:24 +01:00
parent b676392315
commit 917a2f4dc7
5 changed files with 7 additions and 17 deletions

Binary file not shown.

View File

@ -5,8 +5,6 @@ import java.util.Scanner;
import de.mas.wupclient.client.WUPClient; import de.mas.wupclient.client.WUPClient;
import de.mas.wupclient.client.operations.DownloadUploadOperations; import de.mas.wupclient.client.operations.DownloadUploadOperations;
import de.mas.wupclient.client.operations.DumperOperations; import de.mas.wupclient.client.operations.DumperOperations;
import de.mas.wupclient.client.operations.FileOperations;
import de.mas.wupclient.client.operations.SpecialOperations;
import de.mas.wupclient.client.operations.UtilOperations; import de.mas.wupclient.client.operations.UtilOperations;
public class Starter { public class Starter {
@ -19,7 +17,8 @@ public class Starter {
try { try {
boolean exit = false; boolean exit = false;
System.out.println("JWUPClient. Please enter a command. Enter \"exit\" to exit."); System.out.println("JWUPClient 0.1a");
System.out.println("Please enter a command. Enter \"exit\" to exit.");
System.out.println(); System.out.println();
System.out.print(w.getCwd() + " > "); System.out.print(w.getCwd() + " > ");
Scanner reader = new Scanner(System.in); // Reading from System.in Scanner reader = new Scanner(System.in); // Reading from System.in
@ -29,6 +28,7 @@ public class Starter {
String input = reader.nextLine(); String input = reader.nextLine();
if(input.equals("exit")){ if(input.equals("exit")){
exit = true; exit = true;
break; break;
} }
processCommand(input,w); processCommand(input,w);
@ -52,7 +52,6 @@ public class Starter {
return; return;
} }
UtilOperations util = UtilOperations.UtilOperationsFactory(w); UtilOperations util = UtilOperations.UtilOperationsFactory(w);
SpecialOperations special = SpecialOperations.SpecialOperationsFactory(w);
DownloadUploadOperations dlul = DownloadUploadOperations.DownloadUploadOperationsFactory(w); DownloadUploadOperations dlul = DownloadUploadOperations.DownloadUploadOperationsFactory(w);
DumperOperations dump = DumperOperations.DumperOperationsFactory(w); DumperOperations dump = DumperOperations.DumperOperationsFactory(w);
@ -118,10 +117,6 @@ public class Starter {
dlul.downloadFile("", inputs[1],inputs[2] + "/" + w.getCwd()); dlul.downloadFile("", inputs[1],inputs[2] + "/" + w.getCwd());
} }
break;
case "nandtickets": //download to full path
special.parseAndDownloadTickets();
break; break;
case "dumpdisc": case "dumpdisc":
String pattern = ".*"; String pattern = ".*";

View File

@ -125,10 +125,11 @@ public class WUPClient {
clientSocket = new Socket(ip, 1337); clientSocket = new Socket(ip, 1337);
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
Logger.logErr("Unkown Host"); Logger.logErr("Unkown Host");
e.printStackTrace(); Logger.logErr("Make sure you entered the correct ip (tried " + ip + ") and the wupserver in running.");
System.exit(-1);
} catch (IOException e) { } catch (IOException e) {
Logger.logErr("IO Error Host"); Logger.logErr("IO Error Host");
e.printStackTrace(); System.exit(-1);
} }
setSocket(clientSocket); setSocket(clientSocket);
Logger.log("Connected to " + ip); Logger.log("Connected to " + ip);

View File

@ -1,17 +1,11 @@
package de.mas.wupclient.client.operations; package de.mas.wupclient.client.operations;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import de.mas.wupclient.client.WUPClient; import de.mas.wupclient.client.WUPClient;
import de.mas.wupclient.client.utils.FEntry;
import de.mas.wupclient.client.utils.Logger; import de.mas.wupclient.client.utils.Logger;
import de.mas.wupclient.client.utils.MetaInformation; import de.mas.wupclient.client.utils.MetaInformation;
import de.mas.wupclient.client.utils.Utils; import de.mas.wupclient.client.utils.Utils;

View File

@ -118,7 +118,7 @@ public class FileOperations extends Operations {
} }
i += result_val; i += result_val;
Result<byte[]> result_write = fsa.FSA_WriteFilePtr(fsa_handle, dst_handle, 0x1, result_val, buffer_ptr); Result<byte[]> result_write = fsa.FSA_WriteFilePtr(fsa_handle, dst_handle, 0x1, result_val, buffer_ptr);
int result_write_val = result_read.getResultValue(); int result_write_val = result_write.getResultValue();
if(result_write_val < 0){ if(result_write_val < 0){
Logger.log("copyFile error: writing destination file failed."); Logger.log("copyFile error: writing destination file failed.");
result = false; result = false;