@@ -82,6 +82,8 @@ public <T> T convert(final Object src, final Class<T> dest) { | |||
| 82 | 82 | final String[] tokens = StringUtils.splitUnquoted((String) src, ","); | |
| 83 | 83 | final List<File> fileList = new ArrayList<>(); | |
| 84 | 84 | for (final String filePath : tokens) { | |
| 85 | + if ( filePath.isEmpty() ) | ||
| 86 | + continue; | ||
| 85 | 87 | fileList.add(new File(filePath.replaceAll("^\"|\"$", ""))); | |
| 86 | 88 | } | |
| 87 | 89 | return (T) fileList.toArray(new File[fileList.size()]); | |
@@ -69,6 +69,7 @@ public void testStringToFileArrayConverter() { | |||
| 69 | 69 | conv.convert(path, File[].class)[0]); | |
| 70 | 70 | assertEquals("Wrong file name", new File("C:\\temp"), | |
| 71 | 71 | conv.convert(path, File[].class)[1]); | |
| 72 | + assertEquals( 0, conv.convert( "", File[].class ).length ); | ||
| 72 | 73 | } | |
| 73 | 74 | ||
| 74 | 75 | @Test | |
0 commit comments