Skip to content

BAEL-2076: loading resources#7347

Merged
ashleyfrieze merged 5 commits intomasterfrom
unknown repository
Sep 5, 2019
Merged

BAEL-2076: loading resources#7347
ashleyfrieze merged 5 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jul 18, 2019

  • Created core-java-io2 module
  • added resource loading example code
  • added core-java-io2 to tutorials pom.xml

- Created core-java-io2 module
- added resource loading example code
- added core-java-io2 to tutorials pom.xml
Comment thread core-java-modules/core-java-io2/README.md Outdated
- change to try-with-resources
- change the order of main method

private void loadFileWithReader() throws IOException {

try (FileReader fileReader = new FileReader("src/main/resources/input.txt"); BufferedReader reader = new BufferedReader(fileReader)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would probably help if you put a linebreak after the ; here


private void loadFileAsResource() throws IOException {

try (InputStream inputStream = getClass().getResourceAsStream("/input.txt"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

another ; / linebreak combo here too please

@maibin maibin closed this Sep 5, 2019
@ashleyfrieze ashleyfrieze reopened this Sep 5, 2019
@ashleyfrieze ashleyfrieze merged commit c85be3d into eugenp:master Sep 5, 2019
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.

3 participants