mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
use avian.http.Handler for http(s) URLs, not avian.file.Handler
This commit is contained in:
parent
574a8ea1e2
commit
b5fda8ee13
26
classpath/avian/http/Handler.java
Normal file
26
classpath/avian/http/Handler.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* Copyright (c) 2012, Avian Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software
|
||||||
|
for any purpose with or without fee is hereby granted, provided
|
||||||
|
that the above copyright notice and this permission notice appear
|
||||||
|
in all copies.
|
||||||
|
|
||||||
|
There is NO WARRANTY for this software. See license.txt for
|
||||||
|
details. */
|
||||||
|
|
||||||
|
package avian.http;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLStreamHandler;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
public class Handler extends URLStreamHandler {
|
||||||
|
protected URLConnection openConnection(URL url) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
}
|
@ -81,10 +81,8 @@ public final class URL {
|
|||||||
private static URLStreamHandler findHandler(String protocol)
|
private static URLStreamHandler findHandler(String protocol)
|
||||||
throws MalformedURLException
|
throws MalformedURLException
|
||||||
{
|
{
|
||||||
if ("http".equals(protocol)) {
|
if ("http".equals(protocol) || "https".equals(protocol)) {
|
||||||
return new avian.file.Handler();
|
return new avian.http.Handler();
|
||||||
} else if ("https".equals(protocol)) {
|
|
||||||
return new avian.file.Handler();
|
|
||||||
} else if ("resource".equals(protocol)) {
|
} else if ("resource".equals(protocol)) {
|
||||||
return new avian.resource.Handler();
|
return new avian.resource.Handler();
|
||||||
} else if ("file".equals(protocol)) {
|
} else if ("file".equals(protocol)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user