mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection
Reviewed-by: dfuchs
This commit is contained in:
parent
a07e19d833
commit
f34f8d4d6a
1 changed files with 11 additions and 31 deletions
|
@ -25,21 +25,17 @@
|
||||||
|
|
||||||
package sun.net.www.protocol.jar;
|
package sun.net.www.protocol.jar;
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.net.URL;
|
import java.io.FileNotFoundException;
|
||||||
import java.net.URLConnection;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.UnknownServiceException;
|
import java.net.URL;
|
||||||
import java.util.Enumeration;
|
import java.security.Permission;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
import java.util.jar.Manifest;
|
|
||||||
import java.security.Permission;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Benjamin Renaud
|
* @author Benjamin Renaud
|
||||||
|
@ -47,26 +43,10 @@ import java.security.Permission;
|
||||||
*/
|
*/
|
||||||
public class JarURLConnection extends java.net.JarURLConnection {
|
public class JarURLConnection extends java.net.JarURLConnection {
|
||||||
|
|
||||||
private static final boolean debug = false;
|
|
||||||
|
|
||||||
/* the Jar file factory. It handles both retrieval and caching.
|
/* the Jar file factory. It handles both retrieval and caching.
|
||||||
*/
|
*/
|
||||||
private static final JarFileFactory factory = JarFileFactory.getInstance();
|
private static final JarFileFactory factory = JarFileFactory.getInstance();
|
||||||
|
|
||||||
/* the url for the Jar file */
|
|
||||||
private URL jarFileURL;
|
|
||||||
|
|
||||||
/* the permission to get this JAR file. This is the actual, ultimate,
|
|
||||||
* permission, returned by the jar file factory.
|
|
||||||
*/
|
|
||||||
private Permission permission;
|
|
||||||
|
|
||||||
/* the url connection for the JAR file */
|
|
||||||
private URLConnection jarFileURLConnection;
|
|
||||||
|
|
||||||
/* the entry name, if any */
|
|
||||||
private String entryName;
|
|
||||||
|
|
||||||
/* the JarEntry */
|
/* the JarEntry */
|
||||||
private JarEntry jarEntry;
|
private JarEntry jarEntry;
|
||||||
|
|
||||||
|
@ -80,12 +60,10 @@ public class JarURLConnection extends java.net.JarURLConnection {
|
||||||
throws MalformedURLException, IOException {
|
throws MalformedURLException, IOException {
|
||||||
super(url);
|
super(url);
|
||||||
|
|
||||||
jarFileURL = getJarFileURL();
|
jarFileURLConnection = getJarFileURL().openConnection();
|
||||||
jarFileURLConnection = jarFileURL.openConnection();
|
|
||||||
// whether, or not, the embedded URL should use the cache will depend
|
// whether, or not, the embedded URL should use the cache will depend
|
||||||
// on this instance's cache value
|
// on this instance's cache value
|
||||||
jarFileURLConnection.setUseCaches(useCaches);
|
jarFileURLConnection.setUseCaches(useCaches);
|
||||||
entryName = getEntryName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JarFile getJarFile() throws IOException {
|
public JarFile getJarFile() throws IOException {
|
||||||
|
@ -120,7 +98,7 @@ public class JarURLConnection extends java.net.JarURLConnection {
|
||||||
public void connect() throws IOException {
|
public void connect() throws IOException {
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
boolean useCaches = getUseCaches();
|
boolean useCaches = getUseCaches();
|
||||||
String entryName = this.entryName;
|
String entryName = getEntryName();
|
||||||
|
|
||||||
/* the factory call will do the security checks */
|
/* the factory call will do the security checks */
|
||||||
URL url = getJarFileURL();
|
URL url = getJarFileURL();
|
||||||
|
@ -176,6 +154,7 @@ public class JarURLConnection extends java.net.JarURLConnection {
|
||||||
|
|
||||||
InputStream result = null;
|
InputStream result = null;
|
||||||
|
|
||||||
|
String entryName = getEntryName();
|
||||||
if (entryName == null) {
|
if (entryName == null) {
|
||||||
throw new IOException("no entry name specified");
|
throw new IOException("no entry name specified");
|
||||||
} else {
|
} else {
|
||||||
|
@ -216,7 +195,7 @@ public class JarURLConnection extends java.net.JarURLConnection {
|
||||||
Object result = null;
|
Object result = null;
|
||||||
|
|
||||||
connect();
|
connect();
|
||||||
if (entryName == null) {
|
if (getEntryName() == null) {
|
||||||
result = jarFile;
|
result = jarFile;
|
||||||
} else {
|
} else {
|
||||||
result = super.getContent();
|
result = super.getContent();
|
||||||
|
@ -226,6 +205,7 @@ public class JarURLConnection extends java.net.JarURLConnection {
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
if (contentType == null) {
|
if (contentType == null) {
|
||||||
|
String entryName = getEntryName();
|
||||||
if (entryName == null) {
|
if (entryName == null) {
|
||||||
contentType = "x-java/jar";
|
contentType = "x-java/jar";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue