1 28 29 package com.caucho.vfs; 30 31 import com.caucho.util.L10N; 32 33 import java.io.IOException ; 34 import java.util.Map ; 35 36 41 public class HttpsPath extends HttpPath { 42 protected static L10N L = new L10N(HttpsPath.class); 43 44 50 public HttpsPath(String host, int port) 51 { 52 super(host, port); 53 } 54 55 64 public HttpsPath(FilesystemPath root, String userPath, 65 Map <String ,Object > newAttributes, 66 String path, String query) 67 { 68 super(root, userPath, newAttributes, path, query); 69 } 70 71 protected HttpPath create(String host, int port) 72 { 73 return new HttpsPath(host, port); 74 } 75 76 protected HttpPath create(FilesystemPath root, 77 String userPath, 78 Map <String ,Object > newAttributes, 79 String path, String query) 80 { 81 return new HttpsPath(root, userPath, newAttributes, path, query); 82 } 83 84 87 public String getScheme() 88 { 89 return "https"; 90 } 91 92 95 public StreamImpl openReadImpl() throws IOException 96 { 97 HttpStreamWrapper stream = HttpStream.openRead(this); 98 99 stream.setSSL(true); 100 101 return stream; 102 } 103 104 107 public StreamImpl openReadWriteImpl() throws IOException 108 { 109 HttpStreamWrapper stream = HttpStream.openReadWrite(this); 110 111 stream.setSSL(true); 112 113 return stream; 114 } 115 116 119 public int hashCode() 120 { 121 return 17 + 65537 * super.hashCode() + 37 * _host.hashCode() + _port; 122 } 123 124 127 public boolean equals(Object o) 128 { 129 if (! (o instanceof HttpsPath)) 130 return false; 131 132 HttpsPath test = (HttpsPath) o; 133 134 if (! _host.equals(test._host)) 135 return false; 136 else if (_port != test._port) 137 return false; 138 else if (_query != null && ! _query.equals(test._query)) 139 return false; 140 else if (_query == null && test._query != null) 141 return false; 142 else 143 return true; 144 } 145 } 146 | Popular Tags |