Add missing parse Exception
@@ -28,6 +28,7 @@ import org.streampipes.connect.adapter.generic.pipeline.AdapterPipeline;
import org.streampipes.connect.adapter.generic.protocol.Protocol;
import org.streampipes.connect.adapter.generic.sdk.ParameterExtractor;
import org.streampipes.connect.exception.AdapterException;
+import org.streampipes.connect.exception.ParseException;
import org.streampipes.model.connect.guess.GuessSchema;
import org.streampipes.model.connect.grounding.ProtocolDescription;
import org.streampipes.model.schema.EventSchema;
@@ -118,12 +119,11 @@ public class FileProtocol extends Protocol {
@Override
- public GuessSchema getGuessSchema() throws AdapterException {
+ public GuessSchema getGuessSchema() throws ParseException {
InputStream dataInputStream = getDataFromEndpoint();
- if (dataInputStream == null)
- throw new AdapterException("Could not receive data from Endpoint: " + fileUri);
+ new AdapterException("Could not receive data from Endpoint: " + fileUri);
List<byte[]> dataByte = parser.parseNEvents(dataInputStream, 20);
@@ -174,12 +174,10 @@ public class FileProtocol extends Protocol {
return inn;
}
@Override
- public List<Map<String, Object>> getNElements(int n) throws AdapterException {
+ public List<Map<String, Object>> getNElements(int n) throws ParseException {
List<Map<String, Object>> result = new ArrayList<>();
InputStream dataInputStream = getDataFromEndpoint();
- if (dataInputStream == null)
- throw new AdapterException("Could not receive data from Endpoint: " + fileUri);
List<byte[]> dataByteArray = parser.parseNEvents(dataInputStream, n);
