home *** CD-ROM | disk | FTP | other *** search
- package sun.net.www.protocol.doc;
-
- import java.io.BufferedInputStream;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.URL;
- import sun.net.www.MessageHeader;
- import sun.net.www.MimeEntry;
- import sun.net.www.MimeTable;
- import sun.net.www.URLConnection;
-
- public class DocURLConnection extends URLConnection {
- // $FF: renamed from: is java.io.InputStream
- InputStream field_0;
- static String installDirectory = System.getProperty("hotjava.home");
-
- DocURLConnection(URL var1) {
- super(var1);
- }
-
- public void connect() throws IOException {
- String var1 = installDirectory + super.url.getFile();
- MessageHeader var2 = new MessageHeader();
- MimeTable var3 = MimeTable.getDefaultTable();
- MimeEntry var4 = var3.findByFileName(var1);
- if (var4 != null) {
- var2.add("content-type", var4.getType());
- }
-
- ((URLConnection)this).setProperties(var2);
- File var5 = new File(var1);
- if (var5.exists()) {
- var2.add("Content-length", String.valueOf(var5.length()));
- }
-
- this.field_0 = new BufferedInputStream(new FileInputStream(var1.replace('/', File.separatorChar)));
- super.connected = true;
- }
-
- public synchronized InputStream getInputStream() throws IOException {
- if (!super.connected) {
- this.connect();
- }
-
- return this.field_0;
- }
-
- static {
- if (installDirectory == null) {
- installDirectory = "/usr/local/hotjava";
- }
-
- }
- }
-