/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
int actualPort;
try {
u.openConnection().getPermission();
try {
} catch (SecurityException se) {
// fallback to checkRead/checkConnect for pre 1.2
// security managers
} else if ((perm instanceof
} else {
throw se;
}
}
}
}
}
this.url = u;
}
}
this(u);
}
}
// the image was actually fetched from were different than the
// one of the download attempts. The original URL security was
// checked when the applet got a handle to the image, so we only
if (actualHost != null) {
try {
}
} catch (SecurityException e) {
if (!quiet) {
throw e;
}
return false;
}
}
return true;
}
c = conn;
} else {
c = url.openConnection();
}
return c;
}
URLConnection c = null;
try {
c = getConnection();
is = c.getInputStream();
type = c.getContentType();
{
// listed in the original URL, or it can come from one other
// and we give up and just throw a SecurityException.
actualPort != u.getPort()))
{
throw new SecurityException("image moved!");
}
actualHost = u.getHost();
actualPort = u.getPort();
}
} catch (IOException e) {
try {
} catch (IOException e2) {
}
} else if (c instanceof HttpURLConnection) {
((HttpURLConnection)c).disconnect();
}
return null;
}
}
// probably, no appropriate decoder
try {
} catch (IOException e) {
}
} else if (c instanceof HttpURLConnection) {
((HttpURLConnection)c).disconnect();
}
}
return id;
}
}