-
8000
-
Notifications
You must be signed in to change notification settings - Fork 308
Change createTempDir to use Java nio Files package #7329
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
base: main
Are you sure you want to change the base?
Conversation
throw new IOException("Cannot create temp directory" + temp.getAbsolutePath()); | ||
} | ||
return temp; | ||
private File createTempDir(final String prefix) throws IOException { |
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.
This cannot compile unless you change the calling code.
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.
Thanks for pointing that out! Updated the callsite at line 450
@hsuk04 You must sign a CLA for this change to be accepted. Please see https://github.com/payara/Payara/blob/main/.github/CONTRIBUTING.md |
Thanks, i've prepped CLA but when i sent it to cla@payara.org, the email bounces (says sender outside org not allowed, code 550 5.7.193). I sent using the email associated with the commits, could I get some help on this? Sorry for bothering again! |
@Pandrex247 might be able to help you with this. |
I'll give our IT department a poke |
@hsuk04 we had some configuration issues preventing you from sending mail to that address but I can confirm it is working now if you would like to retry. Apologies for the inconvenience. Thanks to @Pandrex247 for raising the issue. |
Thanks all for helping, successfully emailed in already |
Description
This PR changes the createTempDir method in CheckpointHelper.java to use Files.createTempDirectory for safer and more modern temporary directory creation. Removes potential race condition and simplifies the code by leveraging the atomic directory creation provided by the Java nio files package
Documentation
Similar thing was done here: openkm/document-management-system@c069e4d