Removes unnecessary duplicate file name cleaning
This commit is contained in:
@@ -15,7 +15,6 @@ import java.io.File;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash;
|
import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash;
|
||||||
import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.cleanString;
|
|
||||||
import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixName;
|
import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,7 +153,7 @@ public final class BookHelper {
|
|||||||
"book would lead to unexpected problems.");
|
"book would lead to unexpected problems.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return fixName(cleanString(bookName + titleAuthorSeparator + authorName), false);
|
return fixName(InputCleaningHelper.cleanString(bookName + titleAuthorSeparator + authorName), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -60,7 +60,7 @@ public final class BookToFromTextHelper {
|
|||||||
bookYml.set("Lore", bookMetadata.getLore());
|
bookYml.set("Lore", bookMetadata.getLore());
|
||||||
}
|
}
|
||||||
|
|
||||||
bookYml.save(path + InputCleaningHelper.cleanString(fileName) + ".yml");
|
bookYml.save(path + fileName + ".yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,7 +90,7 @@ public final class BookToFromTextHelper {
|
|||||||
* @throws IOException <p>If unable to save the book</p>
|
* @throws IOException <p>If unable to save the book</p>
|
||||||
*/
|
*/
|
||||||
public static void bookToTXT(@NotNull String folderPath, @NotNull String fileName, @NotNull BookMeta bookMetadata) throws IOException {
|
public static void bookToTXT(@NotNull String folderPath, @NotNull String fileName, @NotNull BookMeta bookMetadata) throws IOException {
|
||||||
FileWriter fileWriter = new FileWriter(folderPath + InputCleaningHelper.cleanString(fileName) + ".txt", StandardCharsets.UTF_8);
|
FileWriter fileWriter = new FileWriter(folderPath + fileName + ".txt", StandardCharsets.UTF_8);
|
||||||
PrintWriter printWriter = new PrintWriter(fileWriter);
|
PrintWriter printWriter = new PrintWriter(fileWriter);
|
||||||
List<String> pages = bookMetadata.getPages();
|
List<String> pages = bookMetadata.getPages();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user