-
Notifications
You must be signed in to change notification settings - Fork 173
Added support for getting a list of files from a jar directory in ResourceOf. #1757
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
base: master
Are you sure you want to change the base?
Conversation
80cef20
to
7ebc4cd
Compare
@yegor256 Will you please review? |
@PeJetuz thanks for the contribution! I'm not sure the location of the |
7ebc4cd
to
08d9555
Compare
@yegor256 Thanks! I don't like |
@PeJetuz indeed, it's good to have sources in Git repo, instead of a binary |
@yegor256 Now |
@PeJetuz "force push" is a bad idea in general, because it's confusing for the reviewer (just FYI) |
@PeJetuz it's not a good idea to keep binary files inside Git repository. Better generate/build this JAR in compile time, and place into |
@yegor256 I thought it was important to you that the intermediate results were not included in the final commit. Thank you, I will fix it! |
Added building test data in test-lib.jar before compilation.
@yegor256 Done. Thanks! |
Collectors.joining("\n") | ||
) | ||
.getBytes(StandardCharsets.UTF_8) | ||
); |
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.
@PeJetuz why not this formatting instead?
return new InputStreamOf(
names
.stream()
.collect(Collectors.joining("\n"))
.getBytes(StandardCharsets.UTF_8)
);
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.
@yegor256 Done.
final String name = entry.getName(); | ||
if (this.path.equals(name)) { | ||
continue; | ||
} else if (name.lastIndexOf(this.path) >= 0) { |
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.
@PeJetuz read this, please: https://www.yegor256.com/2015/01/21/if-then-throw-else.html
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.
@yegor256 Thanks for the article. I replaced while/if/else with stream.
@PeJetuz looks much better now, but I still suggest placing it into |
Replaced while and if/else to stream.
b7830db
to
ea68437
Compare
@yegor256 I changed the location of test-lib to src/test. I replaced while/if/else with stream and fixed the formatting. |
@yegor256 Hi! Is there anything else that needs to be improved? |
Added support for getting file names when reading a directory from a jar.
Added a test for getting file names when reading a directory.
Added 'test-data' module that builds a test jar file.