Skip to content

Commit

Permalink
Add choose of the folder option
Browse files Browse the repository at this point in the history
  • Loading branch information
galushko committed Feb 21, 2024
1 parent df24b91 commit 95e9153
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ protected String getQueue() {
@Override
protected String[] getScript(SmartJson rabbitMessage) {
List<Object> arguments = rabbitMessage.getSubMessage(SmartJsonKeys.COMMAND_ARGUMENTS).convertToList();
String folder = (String) arguments.get(0);
String file = (String) arguments.get(1);
String folder = String.valueOf(arguments.get(0));
String file = String.valueOf(arguments.get(1)).replaceAll("\\s+", "\\\\ ");
return new String[]{
"/bin/bash",
"-c",
String.format("\"mv -f %s/%s.torrent %s/%s.torrent\"",
Constants.PATH_TO_UNAPPROVED_FOLDER.replaceAll("\\s+", "\\\\ "),
file.replaceAll("\\s+", "\\\\ "),
Constants.FOLDERS.get(folder).replaceAll("\\s+", "\\\\ "),
Constants.PATH_TO_UNAPPROVED_FOLDER,
file,
Constants.FOLDERS.get(folder),
UUID.randomUUID()
)
};
Expand Down

0 comments on commit 95e9153

Please sign in to comment.