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

JSPWIKI-1148 - Avoid File Stream #47

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

arturobernalg
Copy link
Member

Replace construction of FileInputStream and FileOutputStream objects with Files NIO APIs.
Please note, that the java.nio API does not throw a FileNotFoundException anymore, instead it throws a NoSuchFileException.

https://github.com/apache/jspwiki/blob/master/jspwiki-util/src/main/java/org/apache/wiki/util/PropertyReader.java#L144

@@ -141,15 +142,15 @@ public static Properties loadWebAppProps( final ServletContext context ) {
* @return inputstream holding the properties file
* @throws FileNotFoundException properties file not found
*/
static InputStream loadCustomPropertiesFile( final ServletContext context, final String propertyFile ) throws FileNotFoundException {
static InputStream loadCustomPropertiesFile( final ServletContext context, final String propertyFile ) throws IOException {
Copy link
Member Author

@arturobernalg arturobernalg Mar 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juanpablo-santos
Special careful here. Signature changed.

@arturobernalg
Copy link
Member Author

@juanpablo-santos
Happy easter men.

ping here ;)

@juanpablo-santos
Copy link
Contributor

Hi @arturobernalg ,

apologies for the long delay looking at this PR. I'm +1 on merging it, however, would you mind pls rebasing with latest commits?

As for the signature change, that method is package-protected and seems to be used only by the loadWebAppProps method on the same class, and handled by its try..catch block, so it shouldn't be a big deal..

best regards,
juan pablo

@arturobernalg
Copy link
Member Author

Hi @arturobernalg ,

apologies for the long delay looking at this PR. I'm +1 on merging it, however, would you mind pls rebasing with latest commits?

As for the signature change, that method is package-protected and seems to be used only by the loadWebAppProps method on the same class, and handled by its try..catch block, so it shouldn't be a big deal..

best regards,
juan pablo

HI @juanpablo-santos , rebase from master. I think all the changes are already made previously.
TY

Copy link
Contributor

@juanpablo-santos juanpablo-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@juanpablo-santos juanpablo-santos merged commit 800196d into apache:master Sep 27, 2021
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.

2 participants