1 16 package org.apache.commons.vfs.provider.http; 17 18 import org.apache.commons.vfs.FileSystemConfigBuilder; 19 import org.apache.commons.vfs.FileSystemOptions; 20 21 26 public class HttpFileSystemConfigBuilder extends FileSystemConfigBuilder 27 { 28 private final static HttpFileSystemConfigBuilder builder = new HttpFileSystemConfigBuilder(); 29 30 public static HttpFileSystemConfigBuilder getInstance() 31 { 32 return builder; 33 } 34 35 private HttpFileSystemConfigBuilder() 36 { 37 } 38 39 44 public void setUrlCharset(FileSystemOptions opts, String chaset) 45 { 46 setParam(opts, "urlCharset", chaset); 47 } 48 49 54 public String getUrlCharset(FileSystemOptions opts) 55 { 56 return (String ) getParam(opts, "urlCharset"); 57 } 58 59 66 public void setProxyHost(FileSystemOptions opts, String proxyHost) 67 { 68 setParam(opts, "proxyHost", proxyHost); 69 } 70 71 78 public void setProxyPort(FileSystemOptions opts, int proxyPort) 79 { 80 setParam(opts, "proxyPort", new Integer (proxyPort)); 81 } 82 83 90 public String getProxyHost(FileSystemOptions opts) 91 { 92 return (String ) getParam(opts, "proxyHost"); 93 } 94 95 102 public int getProxyPort(FileSystemOptions opts) 103 { 104 if (!hasParam(opts, "proxyPort")) 105 { 106 return 0; 107 } 108 109 return ((Number ) getParam(opts, "proxyPort")).intValue(); 110 } 111 112 protected Class getConfigClass() 113 { 114 return HttpFileSystem.class; 115 } 116 } 117 | Popular Tags |