This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-xmlschema.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dfd4321 Removing dead code from DefaultURIResolver
7dfd4321 is described below

commit 7dfd4321caae34776c225ecb46a6784b185c4e5f
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Mon Apr 20 11:41:17 2026 +0100

    Removing dead code from DefaultURIResolver
---
 .../schema/resolver/DefaultURIResolver.java        | 92 ----------------------
 1 file changed, 92 deletions(-)

diff --git 
a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/resolver/DefaultURIResolver.java
 
b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/resolver/DefaultURIResolver.java
index 9db62fc0..79747b66 100644
--- 
a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/resolver/DefaultURIResolver.java
+++ 
b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/resolver/DefaultURIResolver.java
@@ -19,7 +19,6 @@
 package org.apache.ws.commons.schema.resolver;
 
 import java.io.File;
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -76,97 +75,6 @@ public class DefaultURIResolver implements 
CollectionURIResolver {
 
     }
 
-    /**
-     * Find whether a given uri is relative or not
-     *
-     * @param uri
-     * @return boolean
-     */
-    protected boolean isAbsolute(String uri) {
-        return uri.startsWith("http://";)
-            || uri.startsWith("https://";)
-            || uri.startsWith("urn:");
-    }
-
-    /**
-     * This is essentially a call to "new URL(contextURL, spec)" with extra 
handling in case spec is a file.
-     *
-     * @param contextURL
-     * @param spec
-     * @throws java.io.IOException
-     */
-    protected URL getURL(URL contextURL, String spec) throws IOException {
-
-        // First, fix the slashes as windows filenames may have backslashes
-        // in them, but the URL class wont do the right thing when we later
-        // process this URL as the contextURL.
-        String path = spec.replace('\\', '/');
-
-        // See if we have a good URL.
-        URL url;
-
-        try {
-
-            // first, try to treat spec as a full URL
-            url = new URL(contextURL, path);
-
-            // if we are deail with files in both cases, create a url
-            // by using the directory of the context URL.
-            if (contextURL != null && url.getProtocol().equals("file")
-                && contextURL.getProtocol().equals("file")) {
-                url = getFileURL(contextURL, path);
-            }
-        } catch (MalformedURLException me) {
-
-            // try treating is as a file pathname
-            url = getFileURL(contextURL, path);
-        }
-
-        // Everything is OK with this URL, although a file url constructed
-        // above may not exist. This will be caught later when the URL is
-        // accessed.
-        return url;
-    } // getURL
-
-    /**
-     * Method getFileURL
-     *
-     * @param contextURL
-     * @param path
-     * @throws IOException
-     */
-    protected URL getFileURL(URL contextURL, String path) throws IOException {
-
-        if (contextURL != null) {
-
-            // get the parent directory of the contextURL, and append
-            // the spec string to the end.
-            String contextFileName = contextURL.getFile();
-            URL parent = null;
-            // the logic for finding the parent file is this.
-            // 1.if the contextURI represents a file then take the parent file
-            // of it
-            // 2. If the contextURI represents a directory, then take that as
-            // the parent
-            File parentFile;
-            File contextFile = new File(contextFileName);
-            if (contextFile.isDirectory()) {
-                parentFile = contextFile;
-            } else {
-                parentFile = contextFile.getParentFile();
-            }
-
-            if (parentFile != null) {
-                parent = parentFile.toURI().toURL();
-            }
-            if (parent != null) {
-                return new URL(parent, path);
-            }
-        }
-
-        return new URL("file", "", path);
-    } // getFileURL
-
     /**
      * Get the base URI derived from a schema collection. It serves as a 
fallback from the specified base.
      *

Reply via email to