-
Notifications
You must be signed in to change notification settings - Fork 492
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
IQSS-5089 - temp file cleanup #5091
IQSS-5089 - temp file cleanup #5091
Conversation
@@ -935,7 +936,32 @@ public static String generateOriginalExtension(String fileType) { | |||
return null; | |||
} // end createDataFiles | |||
|
|||
private static File saveInputStreamInTempFile(InputStream inputStream, Long fileSizeLimit) throws IOException, FileExceedsMaxSizeException { | |||
public static boolean deleteDirectory(File dir) { |
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.
why not just use FileUtils.deleteDirectory(new File(destination));
?
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.
@oscardssmith - not sure what you're suggesting. FWIW: I just moved this method from ShapefileHandler since I added a use in FileUtils and it seemed like a general util function.
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.
My point is that this function does the same thing as FileUtils.deleteDirectory(new File(destination));
and therefore, that should probably be used and this function deleted.
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.
Oh, I see what your confusion is I'm talking about org.apache.commons.io.FileUtils
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.
Got it! I hadn't realized that ShapefileHandler already had that import and was using the apache class. I've deleted the method here and switched to apache.
New Contributors
Welcome! New contributors should at least glance at CONTRIBUTING.md, especially the section on pull requests where we encourage you to reach out to other developers before you start coding. Also, please note that we measure code coverage and prefer you write unit tests. Pull requests can still be reviewed without tests or completion of the checklist outlined below. Thanks!
Related Issues
Pull Request Checklist