home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / net / www / protocol / verbatim / VerbatimConnection.class (.txt) < prev   
Encoding:
Java Class File  |  1979-12-31  |  2.5 KB  |  113 lines

  1. package sun.net.www.protocol.verbatim;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.io.OutputStream;
  6. import java.net.MalformedURLException;
  7. import java.net.URL;
  8. import java.net.URLConnection;
  9. import java.security.Permission;
  10. import sun.net.www.content.text.plain;
  11.  
  12. class VerbatimConnection extends URLConnection {
  13.    URLConnection sub;
  14.  
  15.    protected VerbatimConnection(URL var1) throws MalformedURLException, IOException {
  16.       super(var1);
  17.       String var2 = var1.getFile();
  18.       if (var2.startsWith("/")) {
  19.          var2 = var2.substring(1);
  20.       }
  21.  
  22.       this.sub = (new URL((URL)null, var2)).openConnection();
  23.    }
  24.  
  25.    public void connect() throws IOException {
  26.       this.sub.connect();
  27.    }
  28.  
  29.    public Permission getPermission() throws IOException {
  30.       return this.sub.getPermission();
  31.    }
  32.  
  33.    public String getContentType() {
  34.       return "text/plain";
  35.    }
  36.  
  37.    public String getHeaderField(String var1) {
  38.       return var1.equalsIgnoreCase("content-type") ? this.getContentType() : this.sub.getHeaderField(var1);
  39.    }
  40.  
  41.    public String getHeaderFieldKey(int var1) {
  42.       return this.sub.getHeaderFieldKey(var1);
  43.    }
  44.  
  45.    public String getHeaderField(int var1) {
  46.       return "content-type".equalsIgnoreCase(this.getHeaderFieldKey(var1)) ? this.getContentType() : this.sub.getHeaderField(var1);
  47.    }
  48.  
  49.    public Object getContent() throws IOException {
  50.       return (new plain()).getContent(this.sub);
  51.    }
  52.  
  53.    public InputStream getInputStream() throws IOException {
  54.       return this.sub.getInputStream();
  55.    }
  56.  
  57.    public OutputStream getOutputStream() throws IOException {
  58.       return this.sub.getOutputStream();
  59.    }
  60.  
  61.    public String toString() {
  62.       return "verbatim:" + this.sub.toString();
  63.    }
  64.  
  65.    public void setDoInput(boolean var1) {
  66.       this.sub.setDoInput(var1);
  67.    }
  68.  
  69.    public boolean getDoInput() {
  70.       return this.sub.getDoInput();
  71.    }
  72.  
  73.    public void setDoOutput(boolean var1) {
  74.       this.sub.setDoOutput(var1);
  75.    }
  76.  
  77.    public boolean getDoOutput() {
  78.       return this.sub.getDoOutput();
  79.    }
  80.  
  81.    public void setAllowUserInteraction(boolean var1) {
  82.       this.sub.setAllowUserInteraction(var1);
  83.    }
  84.  
  85.    public boolean getAllowUserInteraction() {
  86.       return this.sub.getAllowUserInteraction();
  87.    }
  88.  
  89.    public void setUseCaches(boolean var1) {
  90.       this.sub.setUseCaches(var1);
  91.    }
  92.  
  93.    public boolean getUseCaches() {
  94.       return this.sub.getUseCaches();
  95.    }
  96.  
  97.    public void setIfModifiedSince(long var1) {
  98.       this.sub.setIfModifiedSince(var1);
  99.    }
  100.  
  101.    public long getIfModifiedSince() {
  102.       return this.sub.getIfModifiedSince();
  103.    }
  104.  
  105.    public void setRequestProperty(String var1, String var2) {
  106.       this.sub.setRequestProperty(var1, var2);
  107.    }
  108.  
  109.    public String getRequestProperty(String var1) {
  110.       return this.sub.getRequestProperty(var1);
  111.    }
  112. }
  113.