summaryrefslogtreecommitdiffstats
path: root/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/client/EmptyResponse.java
blob: 19e9190a32b6e398096d12a1a3e988131105ab96 (plain) (blame)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.client;

import com.ning.http.client.Cookie;
import com.ning.http.client.FluentCaseInsensitiveStringsMap;
import com.ning.http.client.Response;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.List;

/**
 * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a>
 * @since 2.0
 */
final class EmptyResponse implements Response {

    public static final EmptyResponse INSTANCE = new EmptyResponse();

    private EmptyResponse() {
        // hide
    }

    @Override
    public int getStatusCode() {
        return 0;
    }

    @Override
    public String getStatusText() {
        return null;
    }

    @Override
    public ByteBuffer getResponseBodyAsByteBuffer() {
        return ByteBuffer.allocate(0);
    }

    @Override
    public byte[] getResponseBodyAsBytes() throws IOException {
        return new byte[0];
    }

    @Override
    public InputStream getResponseBodyAsStream() throws IOException {
        return null;
    }

    @Override
    public String getResponseBodyExcerpt(int maxLength, String charset) throws IOException {
        return null;
    }

    @Override
    public String getResponseBody(String charset) throws IOException {
        return null;
    }

    @Override
    public String getResponseBodyExcerpt(int maxLength) throws IOException {
        return null;
    }

    @Override
    public String getResponseBody() throws IOException {
        return null;
    }

    @Override
    public URI getUri() throws MalformedURLException {
        return null;
    }

    @Override
    public String getContentType() {
        return null;
    }

    @Override
    public String getHeader(String name) {
        return null;
    }

    @Override
    public List<String> getHeaders(String name) {
        return null;
    }

    @Override
    public FluentCaseInsensitiveStringsMap getHeaders() {
        return null;
    }

    @Override
    public boolean isRedirected() {
        return false;
    }

    @Override
    public List<Cookie> getCookies() {
        return null;
    }

    @Override
    public boolean hasResponseStatus() {
        return false;
    }

    @Override
    public boolean hasResponseHeaders() {
        return false;
    }

    @Override
    public boolean hasResponseBody() {
        return false;
    }
}