forked from wupeixuan/JDKSourceCode1.8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCacheResponse.java
More file actions
64 lines (59 loc) · 1.37 KB
/
CacheResponse.java
File metadata and controls
64 lines (59 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.net;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import java.io.IOException;
/**
* Represent channels for retrieving resources from the
* ResponseCache. Instances of such a class provide an
* InputStream that returns the entity body, and also a
* getHeaders() method which returns the associated response headers.
*
* @author Yingxian Wang
* @since 1.5
*/
public abstract class CacheResponse {
/**
* Returns the response headers as a Map.
*
* @return An immutable Map from response header field names to
* lists of field values. The status line has null as its
* field name.
* @throws IOException if an I/O error occurs
* while getting the response headers
*/
public abstract Map<String, List<String>> getHeaders() throws IOException;
/**
* Returns the response body as an InputStream.
*
* @return an InputStream from which the response body can
* be accessed
* @throws IOException if an I/O error occurs while
* getting the response body
*/
public abstract InputStream getBody() throws IOException;
}