-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed the cleanup renaming which will only rename ".pdf" files. #12396
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
Please have a look at the unit tests, guess due to limiting it to pdf now tests fail and need to be adapted by adding the extension |
… fix/11358-cleanup-renaming
@Siedlerchr made the changes, how it is looking. |
private boolean allowedFileType(String filePath) { | ||
String lowerCase = filePath.toLowerCase(); | ||
|
||
return lowerCase.endsWith(".pdf"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
public static boolean isPDFFile(Path file) { |
Please have a look at the the original issue which asks for more options than just renaming pdf files. For example, I asked if "-fig6" and the "-fig8" postfixes can be retained after renaming. :)
Currently, the postfixes are not respected and the files are categorized by extensions and ordered in their categories. |
@jiucenglou is changes looking good or need some more work ? |
LOGGER.info("Skipping renaming: {}", file.getLink()); | ||
|
||
String fullName = Path.of(file.getLink()).getFileName().toString(); | ||
int dot = fullName.lastIndexOf('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out FileUtli. there is stuff like getFileExtension
and getBaseName
Thanks ! However it is probably necessary to use regex matching instead of looking for "-" right ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
Hi @Siedlerchr, |
Fixes #11358
added a new method allowedFileType which allow clean up to rename only ".pdf files"
other files like "jpeg" or "XYZ" will be skipped for renaming.