Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/javax/net/ssl/HttpsURLConnection/DefaultCacheResponse.java
41152 views
1
/*
2
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
* @bug 8212261
27
* @summary Add SSLSession accessors to HttpsURLConnection and
28
* SecureCacheResponse
29
*/
30
31
import java.io.IOException;
32
import java.io.InputStream;
33
import java.net.SecureCacheResponse;
34
import java.security.Principal;
35
import java.security.cert.Certificate;
36
import java.util.List;
37
import java.util.Map;
38
import java.util.Optional;
39
import javax.net.ssl.SSLPeerUnverifiedException;
40
import javax.net.ssl.SSLSession;
41
42
public class DefaultCacheResponse extends SecureCacheResponse {
43
44
public static void main(String[] args) throws Exception {
45
DefaultCacheResponse defaultImpl = new DefaultCacheResponse();
46
47
Optional<SSLSession> sslSession = defaultImpl.getSSLSession();
48
if (sslSession.isPresent()) {
49
throw new Exception(
50
"The default SecureCacheResponse.getSSLSession " +
51
"implementation should return an empty Optional");
52
}
53
}
54
55
@Override
56
public String getCipherSuite() {
57
throw new UnsupportedOperationException("Not supported yet.");
58
}
59
60
@Override
61
public List<Certificate> getLocalCertificateChain() {
62
throw new UnsupportedOperationException("Not supported yet.");
63
}
64
65
@Override
66
public List<Certificate> getServerCertificateChain()
67
throws SSLPeerUnverifiedException {
68
throw new UnsupportedOperationException("Not supported yet.");
69
}
70
71
@Override
72
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
73
throw new UnsupportedOperationException("Not supported yet.");
74
}
75
76
@Override
77
public Principal getLocalPrincipal() {
78
throw new UnsupportedOperationException("Not supported yet.");
79
}
80
81
@Override
82
public Map<String, List<String>> getHeaders() throws IOException {
83
throw new UnsupportedOperationException("Not supported yet.");
84
}
85
86
@Override
87
public InputStream getBody() throws IOException {
88
throw new UnsupportedOperationException("Not supported yet.");
89
}
90
}
91
92