/*
 * This file is part of ClassGraph.
 *
 * Author: Luke Hutchison
 *
 * Hosted at: https://github.com/classgraph/classgraph
 *
 * --
 *
 * The MIT License (MIT)
 *
 * Copyright (c) 2019 Luke Hutchison
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without
 * limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
 * EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
 * OR OTHER DEALINGS IN THE SOFTWARE.
 */
package io.github.classgraph.issues.issue468;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.FileNotFoundException;
import java.net.URL;

import org.junit.jupiter.api.Test;

import io.github.classgraph.ClassGraph;
import io.github.classgraph.ScanResult;

/**
 * Issue468Test.
 */
public class Issue468Test {
    /** Test '+' signs in URLs. */
    @Test
    public void issue368Test() throws Exception {
        final URL url = Issue468Test.class.getClassLoader().getResource("issue468/x+y/z+w.jar");
        if (url == null) {
            throw new FileNotFoundException();
        }
        System.out.println(url);
        try (ScanResult scanResult = new ClassGraph().acceptPackagesNonRecursive("").overrideClasspath(url)
                .scan()) {
            assertThat(scanResult.getAllResources().getPaths()).containsExactly("innerfile");
        }
    }
}

@@ -1508,16 +1508,58 @@
 sGraph;%0A
+import io.github.classgraph.ResourceList;%0A
 import i
@@ -1644,16 +1644,370 @@
 8Test %7B%0A
+    /** Scan */%0A    private static void scan(final ClassGraph classGraph) %7B%0A        try (ScanResult scanResult = classGraph.scan()) %7B%0A            final ResourceList resources = scanResult.getAllResources();%0A            assertThat(resources.size()).isEqualTo(1);%0A            assertThat(resources.getPaths()).containsExactly(%22innerfile%22);%0A        %7D%0A    %7D%0A%0A
     /** 
@@ -2063,20 +2063,21 @@
 oid 
-issue368Test
+testPlusSigns
 () t
@@ -2287,70 +2287,463 @@
     
-System.out.println
+scan(new ClassGraph().acceptPackagesNonRecursive(%22%22).overrideClasspath
 (url)
+)
 ;%0A    
+%7D%0A%0A
     
-try (ScanResult scanResult = 
+/** Test %22file:%22 URIs as strings, with and without the scheme. */%0A    @Test%0A    public void testFileURIs() throws Exception %7B%0A        final URL url = Issue468Test.class.getClassLoader().getResource(%22issue468/x+y/z+w.jar%22);%0A        if (url == null) %7B%0A            throw new FileNotFoundException();%0A        %7D%0A        final String urlStr = url.toString();%0A        scan(
 new 
@@ -2807,17 +2807,22 @@
 path(url
-)
+Str));
 %0A       
@@ -2826,130 +2826,149 @@
     
-        .scan()) %7B%0A            assertThat(scanResult.getAllResources().getPaths()).containsExactly(%22innerfile%22);%0A        %7D
+assertThat(urlStr).startsWith(%22file:%22);%0A        scan(new ClassGraph().acceptPackagesNonRecursive(%22%22).overrideClasspath(urlStr.substring(5)));
 %0A   

Update test