use avian.http.Handler for http(s) URLs, not avian.file.Handler

This commit is contained in:
Joel Dice 2012-02-27 13:38:47 -07:00
parent 574a8ea1e2
commit b5fda8ee13
3 changed files with 29 additions and 5 deletions

View 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();
}
}

View File

@ -81,10 +81,8 @@ public final class URL {
private static URLStreamHandler findHandler(String protocol)
throws MalformedURLException
{
if ("http".equals(protocol)) {
return new avian.file.Handler();
} else if ("https".equals(protocol)) {
return new avian.file.Handler();
if ("http".equals(protocol) || "https".equals(protocol)) {
return new avian.http.Handler();
} else if ("resource".equals(protocol)) {
return new avian.resource.Handler();
} else if ("file".equals(protocol)) {

View File

@ -1,4 +1,4 @@
#MAKEFLAGS = -s
MAKEFLAGS = -s
name = avian
version = 0.5