static HttpFileBuilder builder(URL url) {
        requireNonNull(url, "url");
        if (url.getPath().endsWith("/")) {
            // Non-existent resource.
            return new NonExistentHttpFileBuilder();
        }

        // Convert to a real file if possible.
        if ("file".equals(url.getProtocol())) {
            File f;
            try {
                f = new File(url.toURI());
            } catch (URISyntaxException ignored) {
                f = new File(url.getPath());
            }

            return builder(f.toPath());
        } else if ("jar".equals(url.getProtocol()) &&
                   (url.getPath().startsWith("file:") || url.getPath().startsWith("nested:")) ||
                   "jrt".equals(url.getProtocol()) ||
                   "bundle".equals(url.getProtocol())) {
            return new ClassPathHttpFileBuilder(url);
        }
        throw new IllegalArgumentException("Unsupported URL: " + url + " (must start with " +
                                           "'file:', 'jar:file', 'jar:nested', 'jrt:' or 'bundle:')");
    }
Returns a new {@link HttpFileBuilder} that builds an {@link HttpFile} from the specified
{@link URL}. {@code file:}, {@code jrt:} and {@linkplain JarURLConnection jar:file:} protocol.
core/src/main/java/com/linecorp/armeria/server/file/HttpFile.java