Returns the contents of the specified input source, ignoring any IOExceptions. @param source the input source from which to read @return the contents of the specified input source, or an empty string if an IOException occurs
(final InputSource source)
| 1105 | * @return the contents of the specified input source, or an empty string if an {@link IOException} occurs |
| 1106 | */ |
| 1107 | private static String toString(final InputSource source) { |
| 1108 | try { |
| 1109 | final Reader reader = source.getReader(); |
| 1110 | if (null != reader) { |
| 1111 | // try to reset to produce some output |
| 1112 | if (reader instanceof StringReader sr) { |
| 1113 | sr.reset(); |
| 1114 | } |
| 1115 | return IOUtils.toString(reader); |
| 1116 | } |
| 1117 | return ""; |
| 1118 | } |
| 1119 | catch (final IOException e) { |
| 1120 | LOG.error(e.getMessage(), e); |
| 1121 | return ""; |
| 1122 | } |
| 1123 | } |
| 1124 | |
| 1125 | /** |
| 1126 | * Validates the list of selectors. |
no test coverage detected