Write to the output @param output @param aString
(Writer output, String aString)
| 128 | * @param aString |
| 129 | */ |
| 130 | public static void write(Writer output, String aString) |
| 131 | { |
| 132 | |
| 133 | String outputString = aString; |
| 134 | |
| 135 | // If there is nothing to write, then return gracefully |
| 136 | if (aString == null) |
| 137 | { |
| 138 | return; |
| 139 | } |
| 140 | |
| 141 | // Trim the string to the length of maxLength |
| 142 | if ((maxLength > 0) && (aString.length() > maxLength)) |
| 143 | { |
| 144 | outputString = aString.substring(0, maxLength); |
| 145 | } |
| 146 | |
| 147 | try |
| 148 | { |
| 149 | output.write(outputString); |
| 150 | } |
| 151 | catch (IOException exception) |
| 152 | { |
| 153 | ShowMessageDelegate.showMessageDialog(exception.getMessage(), Constants.APPLICATION_NAME, |
| 154 | MessageType.ERROR); |
| 155 | } |
| 156 | } |
| 157 | } |
no test coverage detected