private boolean doesLocationMatches()

in winegrower-core/src/main/java/org/apache/winegrower/framework/WinegrowerFramework.java [310:329]


    private boolean doesLocationMatches(final StandaloneScanner.BundleDefinition bundle, final String location) {
        if (bundle.getJar() != null) {
            final boolean direct = location.contains(bundle.getJar().getAbsolutePath());
            if (direct) {
                return true;
            }

            final String normalizedName = location.replace(File.separatorChar, '/');
            if (!normalizedName.contains("/")) {
                return bundle.getJar().getName().equals(normalizedName);
            }

            try {
                return bundle.getJar().toURI().toURL().toExternalForm().equals(location);
            } catch (final MalformedURLException e) {
                return false;
            }
        }
        return false;
    }