/libcore/luni/src/test/java/libcore/java/net/ |
D | URLTest.java | 31 URL url = new URL("http://username:password@host:8080/directory/file?query#ref"); in testUrlParts() local 32 assertEquals("http", url.getProtocol()); in testUrlParts() 33 assertEquals("username:password@host:8080", url.getAuthority()); in testUrlParts() 34 assertEquals("username:password", url.getUserInfo()); in testUrlParts() 35 assertEquals("host", url.getHost()); in testUrlParts() 36 assertEquals(8080, url.getPort()); in testUrlParts() 37 assertEquals(80, url.getDefaultPort()); in testUrlParts() 38 assertEquals("/directory/file?query", url.getFile()); in testUrlParts() 39 assertEquals("/directory/file", url.getPath()); in testUrlParts() 40 assertEquals("query", url.getQuery()); in testUrlParts() [all …]
|
D | OldURLStreamHandlerTest.java | 108 URL url = new URL("http://test.org"); in test_parseURLLjava_net_URLLjava_lang_StringII() local 111 handler.parseURL(url, str, 0, str.length()); in test_parseURLLjava_net_URLLjava_lang_StringII() 134 URL url = new URL("http://test.org"); in test_setURL1() local 137 handler.setURL(url, "http", "localhost", 80, "foo.c", "ref"); in test_setURL1() 144 URL url = new URL("http://test.org"); in test_setURL2() local 147 handler.setURL(url, "http", "localhost", 80, "authority", in test_setURL2() 159 for(URL url : urls) { in test_toExternalForm() 160 assertEquals("Test case for " + url.toString(), in test_toExternalForm() 161 url.toString(), handler.toExternalForm(url)); in test_toExternalForm() 204 @Override public void parseURL(URL url, String spec, int start, int limit) { in parseURL() argument [all …]
|
D | OldJarURLConnectionTest.java | 132 URL url = new URL("jar:file:///bar.jar!/foo.jar!/Bugs/HelloWorld.class"); in test_getEntryName() local 133 …assertEquals("foo.jar!/Bugs/HelloWorld.class",((JarURLConnection)url.openConnection()).getEntryNam… in test_getEntryName() 160 URL url = createContent("lf.jar", "missing"); in test_getJarFile() local 162 JarURLConnection connection = (JarURLConnection) url.openConnection(); in test_getJarFile() 229 URL url = new URL("jar:file:" + file.getPath() + "!/HasAttributes.txt"); in test_setUseCaches() local 231 JarURLConnection connection = (JarURLConnection) url.openConnection(); in test_setUseCaches() 261 URL url = new URL("jar:file:///bar.jar!/foo.jar!/Bugs/HelloWorld.class"); in test_getJarFileURL() local 262 String jarFileUrl = ((JarURLConnection) url.openConnection()).getJarFileURL().toString(); in test_getJarFileURL() 301 URL url = new URL("jar:file:" + jarFileName + "!/" + entry); in test_getInputStream_DeleteJarFileUsingURLConnection() local 302 URLConnection conn = url.openConnection(); in test_getInputStream_DeleteJarFileUsingURLConnection() [all …]
|
D | OldURLClassLoaderTest.java | 174 public void addURL(URL url) { in addURL() argument 175 super.addURL(url); in addURL() 180 URL url) in definePackage() argument 182 return super.definePackage(name, man, url); in definePackage() 258 String url; in getURLClassLoader() local 261 url = "file:" + path; in getURLClassLoader() 263 url = path; in getURLClassLoader() 265 url = "jar:file:" + path + "!/"; in getURLClassLoader() 267 urlList.add(new URL(url)); in getURLClassLoader()
|
D | OldURLTest.java | 245 URL url = new URL("http://web2.javasoft.com/some+file.html"); in testSameFile() local 248 assertFalse(url.sameFile(url1)); in testSameFile() 483 URL url = new URL("http://www.example.com"); in testGetPath() local 484 String output = url.getPath(); in testGetPath() 488 URL url2 = new URL(url,"/foo/index.html"); in testGetPath() 494 URL url = new URL("ftp://myUser:password@host.dom/etc/motd"); in testGetUserInfo() local 496 assertEquals("Assert 0: Wrong user","myUser:password",url.getUserInfo()); in testGetUserInfo() 504 URL url = new URL("http://www.java2s.com:8080"); in testGetAuthority() local 505 assertEquals("Assert 0: Wrong authority ", "www.java2s.com:8080", url in testGetAuthority() 617 public void parse(URL url, String spec, int start, int end) { in parse() argument [all …]
|
/libcore/luni/src/main/java/libcore/net/url/ |
D | FileHandler.java | 18 package libcore.net.url; 42 public URLConnection openConnection(URL url) throws IOException { in openConnection() argument 43 return openConnection(url, null); in openConnection() 64 public URLConnection openConnection(URL url, Proxy proxy) throws IOException { in openConnection() argument 65 if (url == null) { in openConnection() 69 String host = url.getHost(); in openConnection() 71 return new FileURLConnection(url); in openConnection() 75 URL ftpURL = new URL("ftp", host, url.getFile()); in openConnection() 97 protected void parseURL(URL url, String spec, int start, int end) { in parseURL() argument 105 super.parseURL(url, parseString, 0, parseString.length()); in parseURL()
|
D | JarHandler.java | 18 package libcore.net.url; 57 protected void parseURL(URL url, String spec, int start, int limit) { in parseURL() argument 58 String file = url.getFile(); in parseURL() 86 setURL(url, "jar", "", -1, null, null, file, null, null); in parseURL() 97 protected String toExternalForm(URL url) { in toExternalForm() argument 100 sb.append(url.getFile()); in toExternalForm() 101 String ref = url.getRef(); in toExternalForm()
|
D | FtpURLConnection.java | 18 package libcore.net.url; 106 protected FtpURLConnection(URL url) { in FtpURLConnection() argument 107 super(url); in FtpURLConnection() 108 hostName = url.getHost(); in FtpURLConnection() 109 String parse = url.getUserInfo(); in FtpURLConnection() 121 uri = url.toURI(); in FtpURLConnection() 133 protected FtpURLConnection(URL url, Proxy proxy) { in FtpURLConnection() argument 134 this(url); in FtpURLConnection() 142 int idx = url.getFile().lastIndexOf('/'); in cd() 145 String dir = url.getFile().substring(0, idx); in cd() [all …]
|
D | FtpHandler.java | 18 package libcore.net.url; 55 protected URLConnection openConnection(URL url, Proxy proxy) throws IOException { in openConnection() argument 56 if (url == null || proxy == null) { in openConnection() 59 return new FtpURLConnection(url, proxy); in openConnection()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/file/ |
D | FileURLConnectionTest.java | 29 import libcore.net.url.FileURLConnection; 44 final URL url = loader.getResource(resourceName); in createTempFileWithContent() local 45 assertNotNull("Cannot find test resource " + resourceName, url); in createTempFileWithContent() 46 is = url.openStream(); in createTempFileWithContent() 66 URL url = createTempFileWithContent(resourceName); in getContentType() local 67 return new FileURLConnection(url).getContentType(); in getContentType() 83 URL url = createTempFileWithContent(RESOURCE_NAME); in testGetInputStream() local 84 assertNotNull(url); in testGetInputStream() 85 URL anchorUrl = new URL(url, "#anchor"); in testGetInputStream() 94 URL url = createTempFileWithContent(RESOURCE_NAME); in testGetInputStream_localHost() local [all …]
|
/libcore/support/src/test/java/tests/support/ |
D | Support_GetLocal.java | 37 public static File getLocalFile(String url) throws IOException, in getLocalFile() argument 39 url = Support_Resources.RESOURCE_PACKAGE + url; in getLocalFile() 40 File temp = cache.get(url); in getLocalFile() 42 InputStream in = Support_GetLocal.class.getResourceAsStream(url); in getLocalFile() 53 cache.put(url, temp); in getLocalFile() 58 public static File getExternalLocalFile(String url) throws IOException, in getExternalLocalFile() argument 60 File temp = cache.get(url); in getExternalLocalFile() 62 InputStream in = new URL(url).openStream(); in getExternalLocalFile() 73 cache.put(url, temp); in getExternalLocalFile() 78 static ByteArrayInputStream getStream(String url) throws IOException, in getStream() argument [all …]
|
D | Support_ClassLoader.java | 31 public abstract ClassLoader getClassLoader(URL url, ClassLoader parent); in getClassLoader() argument 33 public static ClassLoader getInstance(URL url, ClassLoader parent) { in getInstance() argument 45 return factory.getClassLoader(url, parent); in getInstance() 68 public ClassLoader getClassLoader(URL url, ClassLoader parent) { in getClassLoader() argument 69 return new DexClassLoader(url.getPath(), tmp.getAbsolutePath(), in getClassLoader() 80 public ClassLoader getClassLoader(URL url, ClassLoader parent) { in getClassLoader() argument 81 return new URLClassLoader(new URL[] { url }, parent); in getClassLoader()
|
/libcore/luni/src/main/java/java/net/ |
D | URLStreamHandler.java | 21 import libcore.net.url.UrlUtils; 85 protected void parseURL(URL url, String spec, int start, int end) { in parseURL() argument 86 if (this != url.streamHandler) { in parseURL() 147 authority = url.getAuthority(); in parseURL() 148 userInfo = url.getUserInfo(); in parseURL() 149 host = url.getHost(); in parseURL() 153 port = url.getPort(); in parseURL() 154 path = url.getPath(); in parseURL() 155 query = url.getQuery(); in parseURL() 156 ref = url.getRef(); in parseURL() [all …]
|
D | URLClassLoader.java | 71 static IndexFile readIndexFile(JarFile jf, JarEntry indexEntry, URL url) { in readIndexFile() argument 76 String parentURLString = getParentURL(url).toExternalForm(); in readIndexFile() 123 private static URL getParentURL(URL url) throws IOException { in getParentURL() argument 124 URL fileURL = ((JarURLConnection) url.openConnection()).getJarFileURL(); in getParentURL() 146 URL url; field in URLClassLoader.URLHandler 149 public URLHandler(URL url) { in URLHandler() argument 150 this.url = url; in URLHandler() 151 this.codeSourceUrl = url; in URLHandler() 162 URL resURL = targetURL(url, name); in findClass() 200 URL resURL = targetURL(url, name); in findResource() [all …]
|
D | JarURLConnection.java | 67 protected JarURLConnection(URL url) throws MalformedURLException { in JarURLConnection() argument 68 super(url); in JarURLConnection() 69 file = decode(url.getFile()); in JarURLConnection() 81 if (url.getRef() != null) { in JarURLConnection() 82 entryName += "#" + url.getRef(); in JarURLConnection()
|
D | URLConnection.java | 84 protected URL url; field in URLConnection 156 protected URLConnection(URL url) { in URLConnection() argument 157 this.url = url; in URLConnection() 194 if ((contentType = guessContentTypeFromName(url.getFile())) == null) { in getContent() 228 if ((contentType = guessContentTypeFromName(url.getFile())) == null) { in getContent() 656 return url; in getURL() 679 public static String guessContentTypeFromName(String url) { in guessContentTypeFromName() argument 680 return getFileNameMap().getContentTypeFor(url); in guessContentTypeFromName() 1011 return getClass().getName() + ":" + url.toString(); in toString()
|
D | HttpURLConnection.java | 529 protected HttpURLConnection(URL url) { in HttpURLConnection() argument 530 super(url); in HttpURLConnection() 580 int port = url.getPort(); in getPermission() 584 return new SocketPermission(url.getHost() + ":" + port, in getPermission()
|
/libcore/luni/src/test/java/libcore/java/net/customstreamhandler/http/ |
D | Handler.java | 30 @Override protected URLConnection openConnection(URL url) throws IOException { in openConnection() argument 31 return new HandlerURLConnection(url); in openConnection() 35 protected HandlerURLConnection(URL url) { in HandlerURLConnection() argument 36 super(url); in HandlerURLConnection()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/ |
D | HttpsURLConnectionTest.java | 58 URL url = new URL("https://localhost:55555"); in test_getCipherSuite() local 59 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getCipherSuite() 74 URL url = new URL("https://localhost:55555"); in test_getLocalCertificates() local 75 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getLocalCertificates() 126 URL url = new URL("https://localhost:55555"); in test_getLocalPrincipal() local 127 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getLocalPrincipal() 144 URL url = new URL("https://localhost:55555"); in test_getPeerPrincipal() local 145 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getPeerPrincipal() 167 URL url = new URL("https://localhost:55555"); in test_getServerCertificates() local 168 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getServerCertificates() [all …]
|
/libcore/luni/src/main/java/java/sql/ |
D | DriverManager.java | 143 public static Connection getConnection(String url) throws SQLException { in getConnection() argument 144 return getConnection(url, new Properties()); in getConnection() 165 public static Connection getConnection(String url, Properties info) throws SQLException { in getConnection() argument 169 if (url == null) { in getConnection() 179 Connection theConnection = theDriver.connect(url, info); in getConnection() 204 public static Connection getConnection(String url, String user, String password) in getConnection() argument 213 return getConnection(url, theProperties); in getConnection() 226 public static Driver getDriver(String url) throws SQLException { in getDriver() argument 235 if (driver.acceptsURL(url) && in getDriver()
|
D | Driver.java | 48 public boolean acceptsURL(String url) throws SQLException; in acceptsURL() argument 66 public Connection connect(String url, Properties info) throws SQLException; in connect() argument 105 public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) in getPropertyInfo() argument
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/ |
D | JarURLConnectionTest.java | 78 URL url = copyAndOpenResourceStream("lf.jar", "foo.jar!/Bugs/HelloWorld.class"); in test_getEntryName() local 79 …assertEquals("foo.jar!/Bugs/HelloWorld.class", ((JarURLConnection) url.openConnection()).getEntryN… in test_getEntryName() 99 URL url = copyAndOpenResourceStream("lf.jar", "missing"); in test_getJarFile() local 102 connection = (JarURLConnection) url.openConnection(); in test_getJarFile() 161 URL url = new URL("jar:file:" + file.getPath() + "!/HasAttributes.txt"); in test_setUseCaches() local 163 JarURLConnection connection = (JarURLConnection) url.openConnection(); in test_setUseCaches() 190 URL url = new URL("jar:file:///bar.jar!/foo.jar!/Bugs/HelloWorld.class"); in test_getJarFileURL() local 191 …assertEquals("file:///bar.jar", ((JarURLConnection) url.openConnection()).getJarFileURL().toString… in test_getJarFileURL() 219 URL url = new URL("jar:file:" + file.getAbsolutePath() + "!/entry.txt"); in test_getInputStream_DeleteJarFileUsingURLConnection() local 220 URLConnection conn = url.openConnection(); in test_getInputStream_DeleteJarFileUsingURLConnection() [all …]
|
/libcore/luni/src/test/java/libcore/xml/ |
D | JaxenXPathTestSuite.java | 90 String url = document.getAttribute("url"); in suite() local 91 InputSource inputSource = new InputSource("file:" + jaxenHome + "/" + url); in suite() 93 contextToTestSuite(result, url, inputSource, context); in suite() 103 private static void contextToTestSuite(TestSuite suite, String url, in contextToTestSuite() argument 120 Context context = new Context(inputSource, url, select); in contextToTestSuite() 219 private final String url; 222 Context(InputSource inputSource, String url, String select) { 224 this.url = url; 240 return url + " " + select;
|
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/ |
D | HttpsURLConnectionTest.java | 139 URL url = webServer.getUrl("/"); in testHttpsConnection() local 140 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testHttpsConnection() 172 URL url = webServer.getUrl("/"); in testHttpsConnection_Not_Found_Response() local 173 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testHttpsConnection_Not_Found_Response() 217 URL url = webServer.getUrl("/"); in testSetDefaultSSLSocketFactory() local 218 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testSetDefaultSSLSocketFactory() 257 URL url = webServer.getUrl("/"); in testSetSSLSocketFactory() local 258 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testSetSSLSocketFactory() 290 URL url = new URL("https://localhost:55555"); in testUnconnectedStateParameters() local 291 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testUnconnectedStateParameters() [all …]
|
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/ |
D | HttpURLConnectionTest.java | 191 URL url = new URL("http://localhost:" + server.port()); in testUsingProxy() local 193 HttpURLConnection connection = (HttpURLConnection) url in testUsingProxy() 218 HttpURLConnection huc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); in testUsingProxy() 231 URL url = new URL("http://localhost:" + server.port()); in testUsingProxySelector() local 241 (HttpURLConnection) url.openConnection(); in testUsingProxySelector() 285 URL url = new URL("http://remotehost:55555/requested.data"); in testProxyAuthorization() local 287 (HttpURLConnection) url.openConnection( in testProxyAuthorization()
|