(String headers)
| 195 | } |
| 196 | |
| 197 | public static List<String> formatHeaders(String headers) { |
| 198 | String[] lines; |
| 199 | if (headers == null || headers.trim().isEmpty()) { |
| 200 | return new ArrayList<String>(); |
| 201 | } |
| 202 | ArrayList<String> headerList = new ArrayList<String>(); |
| 203 | for (String line : lines = headers.split("\n")) { |
| 204 | String trimmed = line.trim(); |
| 205 | if (trimmed.isEmpty()) continue; |
| 206 | headerList.add(trimmed); |
| 207 | } |
| 208 | return headerList; |
| 209 | } |
| 210 | } |
| 211 |