use of com.walmartlabs.concord.server.process.ProcessException in project concord by walmartlabs.
the class ResumeConfigurationProcessor method getWorkspaceCfg.
@SuppressWarnings("unchecked")
private static Map<String, Object> getWorkspaceCfg(Payload payload) {
Path workspace = payload.getHeader(Payload.WORKSPACE_DIR);
Path src = workspace.resolve(Constants.Files.CONFIGURATION_FILE_NAME);
if (!Files.exists(src)) {
return Collections.emptyMap();
}
try (InputStream in = Files.newInputStream(src)) {
ObjectMapper om = new ObjectMapper();
return om.readValue(in, Map.class);
} catch (IOException e) {
throw new ProcessException(payload.getProcessKey(), "Invalid request data format", e, Status.BAD_REQUEST);
}
}
Aggregations