diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/api/POSTMapper.java b/src/main/java/ch/ethz/seb/sebserver/gbl/api/POSTMapper.java index a47896e0..f9fd3b5e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/api/POSTMapper.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/api/POSTMapper.java @@ -49,7 +49,7 @@ public class POSTMapper { public String getString(final String name) { final String first = this.params.getFirst(name); - if (StringUtils.isNoneBlank(first)) { + if (StringUtils.isNotBlank(first)) { try { return URLDecoder.decode(first, "UTF-8"); } catch (final UnsupportedEncodingException e) { diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/Orientation.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/Orientation.java index 3feec9a3..783e09b2 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/Orientation.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/Orientation.java @@ -157,19 +157,19 @@ public final class Orientation implements Entity { } public int xpos() { - return this.xPosition != null ? this.xPosition.intValue() : -1; + return this.xPosition != null ? this.xPosition.intValue() : 0; } public int ypos() { - return this.yPosition != null ? this.yPosition.intValue() : -1; + return this.yPosition != null ? this.yPosition.intValue() : 0; } public int width() { - return this.width != null ? this.width.intValue() : -1; + return this.width != null ? this.width.intValue() : 1; } public int height() { - return this.height != null ? this.height.intValue() : -1; + return this.height != null ? this.height.intValue() : 1; } @Override diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java b/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java index ebea2294..72a0b49d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/util/Utils.java @@ -303,4 +303,14 @@ public final class Utils { return builder.toString(); } + public static String preventResponseSplittingAttack(final String string) { + final int xni = string.indexOf('\n'); + final int xri = string.indexOf('\r'); + if (xni >= 0 || xri >= 0) { + throw new IllegalArgumentException("Illegal argument: " + string); + } + + return string; + } + } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java b/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java index ed56f76d..6df7e910 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/InstitutionalAuthenticationEntryPoint.java @@ -67,7 +67,7 @@ final class InstitutionalAuthenticationEntryPoint implements AuthenticationEntry log.info("No default gui entrypoint requested: {}", requestURI); final String logoImageBase64 = requestLogoImage(requestURI); - if (StringUtils.isNoneBlank(logoImageBase64)) { + if (StringUtils.isNotBlank(logoImageBase64)) { // forward request.getSession().setAttribute(API.PARAM_LOGO_IMAGE, logoImageBase64); final RequestDispatcher dispatcher = request.getServletContext() diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/LmsSetupForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/LmsSetupForm.java index 33ca1830..e1e6fb63 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/LmsSetupForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/LmsSetupForm.java @@ -329,11 +329,11 @@ public class LmsSetupForm implements TemplateComposer { if (testResult.isOk()) { return onOK.apply(action); - } else if (StringUtils.isNoneBlank(testResult.tokenRequestError)) { + } else if (StringUtils.isNotBlank(testResult.tokenRequestError)) { throw new PageMessageException( new LocTextKey("sebserver.lmssetup.action.test.tokenRequestError", testResult.tokenRequestError)); - } else if (StringUtils.isNoneBlank(testResult.quizRequestError)) { + } else if (StringUtils.isNotBlank(testResult.quizRequestError)) { throw new PageMessageException( new LocTextKey("sebserver.lmssetup.action.test.quizRequestError", testResult.quizRequestError)); } else { diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/form/Form.java b/src/main/java/ch/ethz/seb/sebserver/gui/form/Form.java index 6a0c3113..8d52f445 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/form/Form.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/form/Form.java @@ -96,7 +96,7 @@ public final class Form implements FormBinding { } public void putStatic(final String name, final String value) { - if (StringUtils.isNoneBlank(value)) { + if (StringUtils.isNotBlank(value)) { this.staticValues.put(name, value); } } @@ -208,7 +208,7 @@ public final class Form implements FormBinding { private void flush() { for (final Map.Entry entry : this.staticValues.entrySet()) { final String value = entry.getValue(); - if (StringUtils.isNoneBlank(value)) { + if (StringUtils.isNotBlank(value)) { this.objectRoot.put(entry.getKey(), value); } } @@ -216,7 +216,7 @@ public final class Form implements FormBinding { for (final Map.Entry> entry : this.formFields.entrySet()) { entry.getValue() .stream() - .filter(ffa -> StringUtils.isNoneBlank(ffa.getStringValue())) + .filter(ffa -> StringUtils.isNotBlank(ffa.getStringValue())) .forEach(ffa -> ffa.putJsonValue(entry.getKey(), this.objectRoot)); } } @@ -334,7 +334,7 @@ public final class Form implements FormBinding { final Tuple tuple, final ObjectNode jsonNode) { - if (StringUtils.isNoneBlank(tuple._2)) { + if (StringUtils.isNotBlank(tuple._2)) { final ArrayNode arrayNode = jsonNode.putArray(tuple._1); final String[] split = StringUtils.split(tuple._2, Constants.LIST_SEPARATOR); for (int i = 0; i < split.length; i++) { @@ -367,7 +367,7 @@ public final class Form implements FormBinding { this.jsonValueAdapter = jsonValueAdapter; } else { this.jsonValueAdapter = (tuple, jsonObject) -> { - if (StringUtils.isNoneBlank(tuple._2)) { + if (StringUtils.isNotBlank(tuple._2)) { jsonObject.put(tuple._1, tuple._2); } }; diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/form/FormBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/form/FormBuilder.java index a98ce987..38c67bc2 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/form/FormBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/form/FormBuilder.java @@ -164,7 +164,7 @@ public class FormBuilder { template.build(this); - if (StringUtils.isNoneBlank(template.group)) { + if (StringUtils.isNotBlank(template.group)) { this.form.addToGroup(template.group, template.name); } @@ -255,7 +255,7 @@ public class FormBuilder { Label valueLabel(final Composite parent, final String value, final int hspan) { final Label label = new Label(parent, SWT.NONE); - label.setText((StringUtils.isNoneBlank(value)) ? value : Constants.EMPTY_NOTE); + label.setText((StringUtils.isNotBlank(value)) ? value : Constants.EMPTY_NOTE); final GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, hspan, 1); gridData.verticalIndent = 4; label.setLayoutData(gridData); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java index e4186eb2..cf56aa6e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java @@ -25,8 +25,8 @@ import org.springframework.stereotype.Service; import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.model.Entity; import ch.ethz.seb.sebserver.gbl.model.EntityName; -import ch.ethz.seb.sebserver.gbl.model.exam.ExamConfigurationMap; import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamType; +import ch.ethz.seb.sebserver.gbl.model.exam.ExamConfigurationMap; import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.IndicatorType; import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; @@ -211,7 +211,7 @@ public class ResourceService { return this.i18nSupport.supportedLanguages() .stream() .map(locale -> new Tuple<>(locale.toLanguageTag(), locale.getDisplayLanguage(currentLocale))) - .filter(tuple -> StringUtils.isNoneBlank(tuple._2)) + .filter(tuple -> StringUtils.isNotBlank(tuple._2)) .sorted((t1, t2) -> t1._2.compareTo(t2._2)) .collect(Collectors.toList()); } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AbstractTableFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AbstractTableFieldBuilder.java index b98884fa..29e66901 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AbstractTableFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AbstractTableFieldBuilder.java @@ -67,11 +67,10 @@ public abstract class AbstractTableFieldBuilder implements InputFieldBuilder { final GridData gridData = new GridData( SWT.FILL, SWT.FILL, true, false, - (tableContext.orientation != null) ? tableContext.orientation.width() : 1, - (tableContext.orientation != null) ? tableContext.orientation.height() : 1); - if (tableContext.orientation.height != null) { - gridData.heightHint = tableContext.orientation.height * 20 + 40; - } + tableContext.orientation.width(), + tableContext.orientation.height()); + + gridData.heightHint = tableContext.orientation.height() * 20 + 40; table.setLayoutData(gridData); table.setHeaderVisible(true); table.addListener(SWT.Resize, event -> adaptColumnWidth(table, tableContext)); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CompositeTableFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CompositeTableFieldBuilder.java index e08936bf..d2f63e34 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CompositeTableFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/CompositeTableFieldBuilder.java @@ -178,7 +178,7 @@ public class CompositeTableFieldBuilder extends AbstractTableFieldBuilder { for (final TableValue val : map.values()) { final Orientation orientation = this.tableContext.getOrientation(val.attributeId); final String groupId = orientation.getGroupId(); - if (StringUtils.isNoneBlank(groupId)) { + if (StringUtils.isNotBlank(groupId)) { final int cellIndex = this.columns.indexOf(groupId); if (cellIndex >= 0) { setValueToCell( diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TableContext.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TableContext.java index a718d36a..54e456ab 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TableContext.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/TableContext.java @@ -51,8 +51,8 @@ public class TableContext { this.attribute = Objects.requireNonNull(attribute); this.viewContext = Objects.requireNonNull(viewContext); - this.orientation = Objects.requireNonNull(viewContext - .getOrientation(attribute.id)); + this.orientation = Objects.requireNonNull( + viewContext.getOrientation(attribute.id)); this.rowAttributes = viewContext.getChildAttributes(attribute.id) .stream() diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/AbstractDownloadServiceHandler.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/AbstractDownloadServiceHandler.java index f23d18ab..f7e5dfec 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/AbstractDownloadServiceHandler.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/AbstractDownloadServiceHandler.java @@ -18,6 +18,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import ch.ethz.seb.sebserver.gbl.api.API; +import ch.ethz.seb.sebserver.gbl.util.Utils; public abstract class AbstractDownloadServiceHandler implements DownloadServiceHandler { @@ -59,9 +60,10 @@ public abstract class AbstractDownloadServiceHandler implements DownloadServiceH response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); response.setContentLength(configFile.length); - response.setHeader( - HttpHeaders.CONTENT_DISPOSITION, - "attachment; filename=\"" + downloadFileName + "\""); + + final String header = + "attachment; filename=\"" + Utils.preventResponseSplittingAttack(downloadFileName) + "\""; + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, header); log.debug("Write the download data to response output"); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java index fadd4911..ea90386b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/ColorSelection.java @@ -66,7 +66,7 @@ public final class ColorSelection extends Composite implements Selection { final Label imageButton = widgetFactory.imageButton( ImageIcon.COLOR, this, - (StringUtils.isNoneBlank(tooltipKeyPrefix) + (StringUtils.isNotBlank(tooltipKeyPrefix) ? new LocTextKey(tooltipKeyPrefix) : DEFAULT_SELECT_TOOLTIP_KEY), this::addColorSelection); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java index c55ce29d..9ae8111c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelection.java @@ -85,7 +85,7 @@ public final class MultiSelection extends Composite implements Selection { }); this.labels.add(label); } - if (StringUtils.isNoneBlank(selectionValue)) { + if (StringUtils.isNotBlank(selectionValue)) { select(selectionValue); } } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelectionCheckbox.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelectionCheckbox.java index d0e677e0..cda8a360 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelectionCheckbox.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/MultiSelectionCheckbox.java @@ -70,7 +70,7 @@ public final class MultiSelectionCheckbox extends Composite implements Selection this.checkboxes.put(tuple._1, button); } - if (StringUtils.isNoneBlank(selectionValue)) { + if (StringUtils.isNotBlank(selectionValue)) { select(selectionValue); } } @@ -79,7 +79,7 @@ public final class MultiSelectionCheckbox extends Composite implements Selection public void applyToolTipsForItems(final List> mapping) { mapping .stream() - .filter(tuple -> StringUtils.isNoneBlank(tuple._2)) + .filter(tuple -> StringUtils.isNotBlank(tuple._2)) .forEach(tuple -> { final Button button = this.checkboxes.get(tuple._1); if (button != null) { diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/RadioSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/RadioSelection.java index 79fa9c77..b7491851 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/RadioSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/RadioSelection.java @@ -67,7 +67,7 @@ public final class RadioSelection extends Composite implements Selection { this.radioButtons.put(tuple._1, button); } - if (StringUtils.isNoneBlank(selectionValue)) { + if (StringUtils.isNotBlank(selectionValue)) { select(selectionValue); } } @@ -76,7 +76,7 @@ public final class RadioSelection extends Composite implements Selection { public void applyToolTipsForItems(final List> mapping) { mapping .stream() - .filter(tuple -> StringUtils.isNoneBlank(tuple._2)) + .filter(tuple -> StringUtils.isNotBlank(tuple._2)) .forEach(tuple -> { final Button button = this.radioButtons.get(tuple._1); if (button != null) { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationServiceImpl.java index 45ce75cf..7c80a4d8 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/PaginationServiceImpl.java @@ -171,10 +171,10 @@ public class PaginationServiceImpl implements PaginationService { final com.github.pagehelper.Page startPage = PageHelper.startPage(getPageNumber(pageNumber), getPageSize(pageSize), true, true, false); - if (table != null && StringUtils.isNoneBlank(sort)) { + if (table != null && StringUtils.isNotBlank(sort)) { final PageSortOrder sortOrder = PageSortOrder.getSortOrder(sort); final String sortColumnName = verifySortColumnName(sort, table); - if (StringUtils.isNoneBlank(sortColumnName)) { + if (StringUtils.isNotBlank(sortColumnName)) { switch (sortOrder) { case DESCENDING: { PageHelper.orderBy(sortColumnName + " DESC"); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java index 0716bbd3..cfed25db 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java @@ -106,7 +106,7 @@ public class ExamDAOImpl implements ExamDAO { final String name = filterMap.getQuizName(); final DateTime from = filterMap.getExamFromTime(); final Predicate quizDataFilter = exam -> { - if (StringUtils.isNoneBlank(name)) { + if (StringUtils.isNotBlank(name)) { if (!exam.name.contains(name)) { return false; } @@ -396,7 +396,7 @@ public class ExamDAOImpl implements ExamDAO { return Result.tryCatch(() -> { - final Collection supporter = (StringUtils.isNoneBlank(record.getSupporter())) + final Collection supporter = (StringUtils.isNotBlank(record.getSupporter())) ? Arrays.asList(StringUtils.split(record.getSupporter(), Constants.LIST_SEPARATOR_CHAR)) : null; diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java index dfc0e347..dca778d2 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java @@ -244,7 +244,7 @@ final class OpenEdxLmsAPITemplate implements LmsAPITemplate { EdXPage page = getEdxPage(pageURI).getBody(); if (page != null) { collector.addAll(page.results); - while (StringUtils.isNoneBlank(page.next)) { + while (StringUtils.isNotBlank(page.next)) { page = getEdxPage(page.next).getBody(); collector.addAll(page.results); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebClientConfigServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebClientConfigServiceImpl.java index 3f97bee9..6587062f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebClientConfigServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebClientConfigServiceImpl.java @@ -96,13 +96,13 @@ public class SebClientConfigServiceImpl implements SebClientConfigService { this.httpScheme = environment.getRequiredProperty(WEB_SERVICE_HTTP_SCHEME_KEY); this.serverAddress = environment.getRequiredProperty(WEB_SERVICE_SERVER_ADDRESS_KEY); - this.serverName = environment.getProperty(WEB_SERVICE_SERVER_NAME_KEY, (String) null); + this.serverName = environment.getProperty(WEB_SERVICE_SERVER_NAME_KEY, ""); this.serverPort = environment.getRequiredProperty(WEB_SERVICE_SERVER_PORT_KEY); this.discoveryEndpoint = environment.getRequiredProperty(WEB_SERVICE_EXAM_API_DISCOVERY_ENDPOINT_KEY); this.serverURLPrefix = UriComponentsBuilder.newInstance() .scheme(this.httpScheme) - .host((StringUtils.isNoneBlank(this.serverName)) + .host((StringUtils.isNotBlank(this.serverName)) ? this.serverName : this.serverAddress) .port(this.serverPort) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebExamConfigServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebExamConfigServiceImpl.java index 5e29a13e..d64d577e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebExamConfigServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebExamConfigServiceImpl.java @@ -66,7 +66,7 @@ public class SebExamConfigServiceImpl implements SebExamConfigService, XMLValueC this.convertersByAttributeName = new HashMap<>(); this.convertersByAttributeType = new HashMap<>(); for (final XMLValueConverter converter : converters) { - if (StringUtils.isNoneBlank(converter.name())) { + if (StringUtils.isNotBlank(converter.name())) { this.convertersByAttributeName.put(converter.name(), converter); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java index a96abcfe..3e64e397 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java @@ -62,7 +62,7 @@ public class ArrayOfStringConverter implements XMLValueConverter { final XMLValueConverterService xmlValueConverterService) throws IOException { final String val = (value.value != null) ? value.value : attribute.getDefaultValue(); - if (StringUtils.isNoneBlank(val)) { + if (StringUtils.isNotBlank(val)) { final String[] values = StringUtils.split(val, Constants.LIST_SEPARATOR); final StringBuilder sb = new StringBuilder(); sb.append(String.format(TEMPLATE, extractName(attribute))); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/IntegerConverter.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/IntegerConverter.java index e276be46..2dc4c678 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/IntegerConverter.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/IntegerConverter.java @@ -60,7 +60,7 @@ public class IntegerConverter implements XMLValueConverter { final XMLValueConverterService xmlValueConverterService) throws IOException { final String val = (value.value != null) ? value.value : attribute.getDefaultValue(); - if (StringUtils.isNoneBlank(val)) { + if (StringUtils.isNotBlank(val)) { out.write(Utils.toByteArray(String.format(TEMPLATE, extractName(attribute), val))); } else { out.write(Utils.toByteArray(String.format(TEMPLATE_EMPTY, extractName(attribute)))); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java index f4b48ee1..d8df12ea 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java @@ -61,7 +61,7 @@ public class StringConverter implements XMLValueConverter { final XMLValueConverterService xmlValueConverterService) throws IOException { final String val = (value.value != null) ? value.value : attribute.getDefaultValue(); - if (StringUtils.isNoneBlank(val)) { + if (StringUtils.isNotBlank(val)) { out.write(Utils.toByteArray(String.format(TEMPLATE, extractName(attribute), val))); } else { out.write(Utils.toByteArray(String.format(TEMPLATE_EMPTY, extractName(attribute)))); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationAttributeController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationAttributeController.java index 83c3cfbf..f01908a6 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationAttributeController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationAttributeController.java @@ -64,7 +64,7 @@ public class ConfigurationAttributeController extends EntityController getForIds( @RequestParam(name = API.PARAM_MODEL_ID_LIST, required = false) final String modelIds) { - if (StringUtils.isNoneBlank(modelIds)) { + if (StringUtils.isNotBlank(modelIds)) { return super.getForIds(modelIds); }