Skip to content

Comments

read json file content#9

Open
VaryaGet wants to merge 1 commit intoArtemGet:mainfrom
VaryaGet:main
Open

read json file content#9
VaryaGet wants to merge 1 commit intoArtemGet:mainfrom
VaryaGet:main

Conversation

@VaryaGet
Copy link

No description provided.

@VaryaGet
Copy link
Author

@ArtemGet look

Copy link
Owner

@ArtemGet ArtemGet left a comment

Choose a reason for hiding this comment

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

() -> {
JsonReader jsonReader = Json.createReader(new StringReader(content.value()));
JsonObject object = jsonReader.readObject();
jsonReader.close();
Copy link
Owner

Choose a reason for hiding this comment

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

Why not using try catch with resources

import io.github.artemget.entrys.Entry;
import io.github.artemget.entrys.file.EFile;

public class EJsonFile extends ESafe<JsonObject> {
Copy link
Owner

Choose a reason for hiding this comment

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

It would be reasonable to add new ctor in https://github.com/ArtemGet/entrys/blob/main/src/main/java/io/github/artemget/entrys/json/EJsonObj.java instead of creating new class

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