-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDataSetStreamSource.java
More file actions
55 lines (45 loc) · 1.17 KB
/
DataSetStreamSource.java
File metadata and controls
55 lines (45 loc) · 1.17 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
package com.nexosis.model;
import com.google.api.client.json.Json;
import java.io.InputStream;
public class DataSetStreamSource implements IDataSetSource {
private InputStream streamReader;
private String name;
private String contentType;
public DataSetStreamSource(String name, InputStream streamReader)
{
this.streamReader = streamReader;
this.name = name;
this.contentType = "text/csv"; //default
}
/**
*
* @return The data
*/
public InputStream getData() {
return streamReader;
}
/**
*
* @return The DataSet name
*/
public String getName() {
return name;
}
/**
*
* @return
*/
public String getContentType() {
return contentType;
}
/**
*
* @param contentType
*/
public void setContentType(String contentType) throws IllegalArgumentException {
if (!contentType.equalsIgnoreCase("text/csv") && !contentType.startsWith("application/json")) {
throw new IllegalArgumentException("contentType must be set to text/csv or application/json");
}
this.contentType = contentType;
}
}