You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/07/06 11:45:35 UTC

[GitHub] [sling-org-apache-sling-feature] kwin opened a new pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

kwin opened a new pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29


   DefaultArtifactHandler.getArtifact(...)


-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] kwin merged pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
kwin merged pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29


   


-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] kwin commented on a change in pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
kwin commented on a change in pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29#discussion_r664470272



##########
File path: src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
##########
@@ -383,16 +385,17 @@ public URL getArtifact(final String url, final String relativeCachePath) {
             logger.debug("Checking url to be local file {}", url);
             // check if this is already a local file
             try {
-                final Path f = Paths.get(new URL(url).toURI());
-                if (Files.exists(f)) {
-                    this.config.incLocalArtifacts();
-                    return f.toUri().toURL();
+                URI uri = new URI(url);
+                if (FileSystems.getDefault().provider().getScheme().equals(uri.getScheme())) {

Review comment:
       Do we need to URIs without a scheme?

##########
File path: src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
##########
@@ -383,16 +385,17 @@ public URL getArtifact(final String url, final String relativeCachePath) {
             logger.debug("Checking url to be local file {}", url);
             // check if this is already a local file
             try {
-                final Path f = Paths.get(new URL(url).toURI());
-                if (Files.exists(f)) {
-                    this.config.incLocalArtifacts();
-                    return f.toUri().toURL();
+                URI uri = new URI(url);
+                if (FileSystems.getDefault().provider().getScheme().equals(uri.getScheme())) {

Review comment:
       Do we need to support URIs without a scheme?

##########
File path: src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
##########
@@ -383,16 +385,17 @@ public URL getArtifact(final String url, final String relativeCachePath) {
             logger.debug("Checking url to be local file {}", url);
             // check if this is already a local file
             try {
-                final Path f = Paths.get(new URL(url).toURI());
-                if (Files.exists(f)) {
-                    this.config.incLocalArtifacts();
-                    return f.toUri().toURL();
+                URI uri = new URI(url);
+                if (FileSystems.getDefault().provider().getScheme().equals(uri.getScheme())) {

Review comment:
       Do we need to support URIs without a scheme for local files?




-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] sonarcloud[bot] commented on pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29#issuecomment-874851522


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='60.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_coverage&view=list) [60.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] sonarcloud[bot] commented on pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29#issuecomment-874681485


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] sonarcloud[bot] removed a comment on pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29#issuecomment-874681485


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=29&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=29&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] kwin commented on pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29#issuecomment-874680028


   @karlpauls Can you provide a test case?


-- 
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: dev-unsubscribe@sling.apache.org

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



[GitHub] [sling-org-apache-sling-feature] karlpauls commented on a change in pull request #29: SLING-10586 prevent java.nio.file.FileSystemNotFoundException during

Posted by GitBox <gi...@apache.org>.
karlpauls commented on a change in pull request #29:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/29#discussion_r664649803



##########
File path: src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java
##########
@@ -383,16 +385,17 @@ public URL getArtifact(final String url, final String relativeCachePath) {
             logger.debug("Checking url to be local file {}", url);
             // check if this is already a local file
             try {
-                final Path f = Paths.get(new URL(url).toURI());
-                if (Files.exists(f)) {
-                    this.config.incLocalArtifacts();
-                    return f.toUri().toURL();
+                URI uri = new URI(url);
+                if (FileSystems.getDefault().provider().getScheme().equals(uri.getScheme())) {

Review comment:
       I think that is handled some place else




-- 
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: dev-unsubscribe@sling.apache.org

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