8000 Change createTempDir to use Java nio Files package by hsuk04 · Pull Request #7329 · payara/Payara · GitHub
[go: up one dir, main page]

Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hsuk04
Copy link
@hsuk04 hsuk04 commented May 3, 2025

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

@Pandrex247 Pandrex247 added the PR: Awaiting CLA Contributor does not have a CLA or has submitted an unconfirmed CLA. label May 5, 2025
throw new IOException("Cannot create temp directory" + temp.getAbsolutePath());
}
return temp;
private File createTempDir(final String prefix) throws IOException {
Copy link
Contributor

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.

Copy link
Author

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

@svendiedrichsen
Copy link
Contributor
svendiedrichsen commented May 8, 2025

@hsuk04 You must sign a CLA for this change to be accepted. Please see https://github.com/payara/Payara/blob/main/.github/CONTRIBUTING.md

@hsuk04
Copy link
Author
hsuk04 commented May 9, 2025

@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!

@svendiedrichsen
Copy link
Contributor

@Pandrex247 might be able to help you with this.

@Pandrex247
Copy link
Member

I'll give our IT department a poke

@eliotmartin
Copy link
Contributor

@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.

@hsuk04
Copy link
Author
hsuk04 commented May 9, 2025

Thanks all for helping, successfully emailed in already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Awaiting CLA Contributor does not have a CLA or has submitted an unconfirmed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0