path = new Path(path, "workflow.xml");
}
FileStatus fsStatus = fs.getFileStatus(path);
if (fsStatus.getLen() > this.maxWFLength) {
throw new WorkflowException(ErrorCode.E0736, fsStatus.getLen(), this.maxWFLength);
}
Reader reader = new InputStreamReader(fs.open(path));
StringWriter writer = new StringWriter();
IOUtils.copyCharStream(reader, writer);
return writer.toString();
}
catch (WorkflowException wfe) {
throw wfe;
}
catch (IOException ex) {
throw new WorkflowException(ErrorCode.E0710, ex.getMessage(), ex);
}
catch (URISyntaxException ex) {
throw new WorkflowException(ErrorCode.E0711, appPath, ex.getMessage(), ex);
}
catch (HadoopAccessorException ex) {
throw new WorkflowException(ex);
}
catch (Exception ex) {
throw new WorkflowException(ErrorCode.E0710, ex.getMessage(), ex);
}
}