aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-core/src/main/java/com/yahoo/feedhandler/InputStreamRequest.java
blob: 00ac9537100df16f5badf2adb94ba7bb7ed52052 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.feedhandler;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

/**
 * Simple wrapper of a stream and some properties.
 *
 * @author bratseth
 */
public class InputStreamRequest {

    private final InputStream input;
    private final Map<String, String> properties = new HashMap<>();

    public InputStreamRequest(InputStream input) {
        this.input = input;
    }

    public void setProperty(String key, String value) {
        properties.put(key, value);
    }

    public String getProperty(String key) {
        return properties.get(key);
    }

    InputStream getData() { return input; }

}