Skip to content

Commit

Permalink
removed unneeded file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
rsehr committed Sep 4, 2024
1 parent 95fa94b commit fe741f4
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void createBackup(String fileName) throws IOException {
message += " Please check the permissions in the configured backup directory.";
log.error(message);
String key = "plugin_administration_ruleset_editor_backup_not_writable_check_permissions";
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append(Helper.getTranslation(key));
buffer.append(" (");
buffer.append(backupPath);
Expand All @@ -76,9 +76,7 @@ public static void writeFile(String fileName, String content) {
if (!Paths.get(RulesetFileUtils.backupDirectory).toFile().exists()) {
RulesetFileUtils.createDirectory(RulesetFileUtils.backupDirectory);
}
if (!Paths.get(fileName).toFile().exists()) {
RulesetFileUtils.createFile(fileName);
}

try {
Charset charset = RulesetFileUtils.standardCharset;
FileUtils.write(new File(fileName), content, charset);
Expand All @@ -91,16 +89,6 @@ public static void writeFile(String fileName, String content) {
}
}

public static void createFile(String fileName) {
Path path = Paths.get(fileName);
try {
StorageProvider.getInstance().createFile(path);
} catch (IOException ioException) {
ioException.printStackTrace();
log.error("RulesetEditorAdministrationPlugin could not create file " + fileName);
}
}

public static void createDirectory(String directoryName) {
Path path = Paths.get(directoryName);
try {
Expand Down

0 comments on commit fe741f4

Please sign in to comment.