You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "cstamas (via GitHub)" <gi...@apache.org> on 2024/02/14 14:30:27 UTC

[PR] Paths everywhere [maven-resolver]

cstamas opened a new pull request, #430:
URL: https://github.com/apache/maven-resolver/pull/430

   This is a DRAFT.
   
   Goal is to make Resolver work with NIO2 Paths fully, and then it becomes possible to use Resolver even on in-memory FS implementations like Google JIMFS.
   
   If you build this locally, and then related Maven PR (w/ japicmp disabled if not fixed), and then uncomment Google FS in demo Booter, you will end up with Resovler DEMOs running on in-memory FS.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Paths everywhere [maven-resolver]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #430:
URL: https://github.com/apache/maven-resolver/pull/430#discussion_r1496175629


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumProcessor.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.internal.impl;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import org.eclipse.aether.spi.io.ChecksumProcessor;
+import org.eclipse.aether.spi.io.PathProcessor;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * A utility class helping with file-based operations.
+ */
+@Singleton
+@Named
+public class DefaultChecksumProcessor implements ChecksumProcessor {
+    private final PathProcessor pathProcessor;
+
+    @Inject
+    public DefaultChecksumProcessor(PathProcessor pathProcessor) {
+        this.pathProcessor = requireNonNull(pathProcessor);
+    }
+
+    @Override
+    public String readChecksum(final Path checksumPath) throws IOException {
+        // 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)) {

Review Comment:
   There is a better way for this: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#newBufferedReader-java.nio.file.Path-java.nio.charset.Charset-



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Paths everywhere [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas merged PR #430:
URL: https://github.com/apache/maven-resolver/pull/430


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Paths everywhere [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #430:
URL: https://github.com/apache/maven-resolver/pull/430#issuecomment-1951255717

   @gnodet @michael-o @slawekjaranowski both PRs (this and Maven https://github.com/apache/maven/pull/1413) are green, please eyeballs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Paths everywhere [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #430:
URL: https://github.com/apache/maven-resolver/pull/430#issuecomment-1954668855

   > 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.
   
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org