Skip to content
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

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Sep 25, 2018

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

@@ -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) {
Copy link
Contributor

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));?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants