From 69360659d9124c8e6f8d4daffe131aff9720c272 Mon Sep 17 00:00:00 2001 From: Sogomn Date: Wed, 16 Mar 2016 21:25:20 +0100 Subject: [PATCH] Small changes Fixed another cross-OS bug --- Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java b/Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java index 8fdf7fd..244802a 100644 --- a/Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java +++ b/Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java @@ -13,6 +13,7 @@ public final class UploadFilePacket implements IPacket { private static final String USER_DIR = "user.dir"; private static final String FILE_SEPARATOR = "/"; + private static final String SEPARATOR_REGEX = "[\\\\\\/]"; public UploadFilePacket(final String filePath, final String folderPath) { this.directoryPath = folderPath; @@ -20,7 +21,7 @@ public final class UploadFilePacket implements IPacket { final File file = new File(filePath); data = FileUtils.readExternalData(filePath); - fileName = file.getName(); + fileName = file.getName().replaceAll(SEPARATOR_REGEX, "/"); } public UploadFilePacket(final File file, final String folderPath) {