boolean removeOriginalColumn = Boolean.parseBoolean(request.getParameter("removeOriginalColumn"));
String mode = request.getParameter("mode");
if ("separator".equals(mode)) {
String maxColumns = request.getParameter("maxColumns");
return new ColumnSplitOperation(
engineConfig,
columnName,
guessCellType,
removeOriginalColumn,
request.getParameter("separator"),
Boolean.parseBoolean(request.getParameter("regex")),
maxColumns != null && maxColumns.length() > 0 ? Integer.parseInt(maxColumns) : 0
);
} else {
String s = request.getParameter("fieldLengths");
JSONArray a = ParsingUtilities.evaluateJsonStringToArray(s);
int[] fieldLengths = new int[a.length()];
for (int i = 0; i < fieldLengths.length; i++) {
fieldLengths[i] = a.getInt(i);
}
return new ColumnSplitOperation(
engineConfig,
columnName,
guessCellType,
removeOriginalColumn,
fieldLengths