home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / net / www / protocol / verbatim / VerbatimConnection.class (.txt) < prev   
Encoding:
Java Class File  |  1997-07-08  |  2.9 KB  |  108 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 sun.net.www.content.text.plain;
  10.  
  11. class VerbatimConnection extends URLConnection {
  12.    URLConnection sub;
  13.  
  14.    protected VerbatimConnection(URL var1) throws MalformedURLException, IOException {
  15.       super(var1);
  16.       String var2 = var1.getFile();
  17.       if (var2.startsWith("/")) {
  18.          var2 = var2.substring(1);
  19.       }
  20.  
  21.       this.sub = (new URL((URL)null, var2)).openConnection();
  22.    }
  23.  
  24.    public void connect() throws IOException {
  25.       this.sub.connect();
  26.    }
  27.  
  28.    public String getContentType() {
  29.       return "text/plain";
  30.    }
  31.  
  32.    public String getHeaderField(String var1) {
  33.       return var1.equalsIgnoreCase("content-type") ? this.getContentType() : this.sub.getHeaderField(var1);
  34.    }
  35.  
  36.    public String getHeaderFieldKey(int var1) {
  37.       return this.sub.getHeaderFieldKey(var1);
  38.    }
  39.  
  40.    public String getHeaderField(int var1) {
  41.       return "content-type".equalsIgnoreCase(this.getHeaderFieldKey(var1)) ? this.getContentType() : this.sub.getHeaderField(var1);
  42.    }
  43.  
  44.    public Object getContent() throws IOException {
  45.       return (new plain()).getContent(this.sub);
  46.    }
  47.  
  48.    public InputStream getInputStream() throws IOException {
  49.       return this.sub.getInputStream();
  50.    }
  51.  
  52.    public OutputStream getOutputStream() throws IOException {
  53.       return this.sub.getOutputStream();
  54.    }
  55.  
  56.    public String toString() {
  57.       return "verbatim:" + this.sub.toString();
  58.    }
  59.  
  60.    public void setDoInput(boolean var1) {
  61.       this.sub.setDoInput(var1);
  62.    }
  63.  
  64.    public boolean getDoInput() {
  65.       return this.sub.getDoInput();
  66.    }
  67.  
  68.    public void setDoOutput(boolean var1) {
  69.       this.sub.setDoOutput(var1);
  70.    }
  71.  
  72.    public boolean getDoOutput() {
  73.       return this.sub.getDoOutput();
  74.    }
  75.  
  76.    public void setAllowUserInteraction(boolean var1) {
  77.       this.sub.setAllowUserInteraction(var1);
  78.    }
  79.  
  80.    public boolean getAllowUserInteraction() {
  81.       return this.sub.getAllowUserInteraction();
  82.    }
  83.  
  84.    public void setUseCaches(boolean var1) {
  85.       this.sub.setUseCaches(var1);
  86.    }
  87.  
  88.    public boolean getUseCaches() {
  89.       return this.sub.getUseCaches();
  90.    }
  91.  
  92.    public void setIfModifiedSince(long var1) {
  93.       this.sub.setIfModifiedSince(var1);
  94.    }
  95.  
  96.    public long getIfModifiedSince() {
  97.       return this.sub.getIfModifiedSince();
  98.    }
  99.  
  100.    public void setRequestProperty(String var1, String var2) {
  101.       this.sub.setRequestProperty(var1, var2);
  102.    }
  103.  
  104.    public String getRequestProperty(String var1) {
  105.       return this.sub.getRequestProperty(var1);
  106.    }
  107. }
  108.