Skip to content

Commit f3612dd

Browse files
Merge pull request #140 from abes-esr/develop
merge dev to test
2 parents bbcdaed + 92ec419 commit f3612dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>fr.abes</groupId>
1111
<artifactId>kbart2kafka</artifactId>
12-
<version>1.0.1</version>
12+
<version>1.0.2-SNAPSHOT</version>
1313
<packaging>jar</packaging>
1414
<name>kbart2kafka</name>
1515
<description>chargement d'un fichier kbart dans kafka</description>

src/main/java/fr/abes/kbart2kafka/utils/CheckFiles.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ public static void verifyFile(File file, String header) throws IllegalFileFormat
100100

101101
public static void isValidUtf8(String input) throws IllegalFileFormatException {
102102
CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder();
103+
String messageErreur = "le fichier contient des caracters qui ne sont pas en UTF8";
103104
try {
104105
decoder.decode(java.nio.ByteBuffer.wrap(input.getBytes(StandardCharsets.UTF_8)));
105106
} catch (CharacterCodingException e) {
106-
throw new IllegalFileFormatException("le fichier contient des caracters qui ne sont pas en UTF8");
107+
throw new IllegalFileFormatException(messageErreur);
108+
}
109+
if(input.contains("�")){
110+
throw new IllegalFileFormatException(messageErreur);
107111
}
108112
}
109113
}

0 commit comments

Comments
 (0)