1 16 package com.sun.org.apache.xerces.internal.util; 17 18 import java.io.InputStream ; 19 import java.io.Reader ; 20 21 import java.util.HashMap ; 22 import java.util.Iterator ; 23 import java.util.Map ; 24 25 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; 26 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; 27 28 41 public final class HTTPInputSource extends XMLInputSource { 42 43 47 48 protected boolean fFollowRedirects = true; 49 50 51 protected Map fHTTPRequestProperties = new HashMap (); 52 53 57 72 public HTTPInputSource(String publicId, String systemId, String baseSystemId) { 73 super(publicId, systemId, baseSystemId); 74 } 76 83 public HTTPInputSource(XMLResourceIdentifier resourceIdentifier) { 84 super(resourceIdentifier); 85 } 87 102 public HTTPInputSource(String publicId, String systemId, 103 String baseSystemId, InputStream byteStream, String encoding) { 104 super(publicId, systemId, baseSystemId, byteStream, encoding); 105 } 107 123 public HTTPInputSource(String publicId, String systemId, 124 String baseSystemId, Reader charStream, String encoding) { 125 super(publicId, systemId, baseSystemId, charStream, encoding); 126 } 128 132 136 public boolean getFollowHTTPRedirects() { 137 return fFollowRedirects; 138 } 140 141 145 public void setFollowHTTPRedirects(boolean followRedirects) { 146 fFollowRedirects = followRedirects; 147 } 149 158 public String getHTTPRequestProperty(String key) { 159 return (String ) fHTTPRequestProperties.get(key); 160 } 162 172 public Iterator getHTTPRequestProperties() { 173 return fHTTPRequestProperties.entrySet().iterator(); 174 } 176 183 public void setHTTPRequestProperty(String key, String value) { 184 if (value != null) { 185 fHTTPRequestProperties.put(key, value); 186 } 187 else { 188 fHTTPRequestProperties.remove(key); 189 } 190 } 192 } | Popular Tags |