1 /* 2 * @(#)CacheResponse.java 1.1 03/09/22 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.net; 9 10 import java.io.InputStream; 11 import java.util.Map; 12 import java.util.List; 13 import java.io.IOException; 14 15 /** 16 * Represent channels for retrieving resources from the 17 * ResponseCache. Instances of such a class provide an 18 * InputStream that returns the entity body, and also a 19 * getHeaders() method which returns the associated response headers. 20 * 21 * @version 1.1, 03/09/22 22 * @author Yingxian Wang 23 * @since 1.5 24 */ 25 public abstract class CacheResponse { 26 27 /** 28 * Returns the response headers as a Map. 29 * 30 * @return An immutable Map from response header field names to 31 * lists of field values. The status line has null as its 32 * field name. 33 * @throws IOException if an I/O error occurs 34 * while getting the response headers 35 */ 36 public abstract Map<String, List<String>> getHeaders() throws IOException; 37 38 /** 39 * Returns the response body as an InputStream. 40 * 41 * @return an InputStream from which the response body can 42 * be accessed 43 * @throws IOException if an I/O error occurs while 44 * getting the response body 45 */ 46 public abstract InputStream getBody() throws IOException; 47 } 48