-
Notifications
You must be signed in to change notification settings - Fork 127
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
Paths everywhere #430
Paths everywhere #430
Conversation
060d277
to
d8bd3c6
Compare
@gnodet @michael-o @slawekjaranowski both PRs (this and Maven apache/maven#1413) are green, please eyeballs |
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.
LGTM
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.
In future, when you request someone to review such a huge PR give people enough time to do it otherwise it does not make sense.
// for now do exactly same as happened before, but FileProcessor is a component and can be replaced | ||
String checksum = ""; | ||
try (BufferedReader br = new BufferedReader( | ||
new InputStreamReader(Files.newInputStream(checksumPath), StandardCharsets.UTF_8), 512)) { |
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.
Sure, and sorry for that. I assumed a week is enough. OTOH, the longer the PR is held back, the new PRs are accumulating and as may saw. requires quite effort to sort out conflicts... So there are two sides of the coin. |
Internally, stop using java.io.File and use NIO2 Paths instead. From outside, this should not make a lot of difference (and is enforced by japicmp as documented here).
But, as a consequence: if Resolver used on FileSystem like Google JIMFS, whatever code touches File method (that will do Path.toFile() under the hood), it will explode. Hence, we need to make sure this call never happens internally, and leave it to consumer projects. Resolver alone should never invoke it.
Most notable changes:
basePath
, hence, if you put your local repository onto non-default FileSystem, it will work just fine (as proved by Demo Snippets). Naturally, if anything touchesFile
returning method, in case of non-default FileSystem, it explodes (Google JIMFs Path.toFile() simply throws).Path
(for example created with JIMFS) and use that to name locks (usefile:
for default FS or any other URIs, iejimfs:
ones).If you build this locally, and then related Maven PR (
w/ japicmp disabled if not fixed), and then uncomment Google FS in demoBooter
class, you will end up with Resolver DEMOs running on in-memory FS.https://issues.apache.org/jira/browse/MRESOLVER-496