From 23a46b4be35277e06ec89f48730eeb694e686be8 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 15:40:06 +0000
Subject: [PATCH] add fdx-commons and fdx-consultation
---
fdx-commons/fdxcommons-core-impl/src/main/java/com/megatim/fdxcommons/core/impl/tools/CommonUtilities.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/fdx-commons/fdxcommons-core-impl/src/main/java/com/megatim/fdxcommons/core/impl/tools/CommonUtilities.java b/fdx-commons/fdxcommons-core-impl/src/main/java/com/megatim/fdxcommons/core/impl/tools/CommonUtilities.java
new file mode 100644
index 0000000..e02a38c
--- /dev/null
+++ b/fdx-commons/fdxcommons-core-impl/src/main/java/com/megatim/fdxcommons/core/impl/tools/CommonUtilities.java
@@ -0,0 +1,56 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.megatim.fdxcommons.core.impl.tools;
+
+import com.megatim.fdxcommons.model.enumeration.TypeDonnee;
+import com.megatim.fdxcommons.model.integration.ColumnDefinition;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * @author ASUS
+ */
+public class CommonUtilities {
+
+ /**
+ * Méthode qui récupère l'encodage d'un fichier
+ *
+ * @param file : Fichier dont on veut connaître l'encodage
+ * @return : retourne l'encodage le plus probable
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ public static Charset getCharset(File file) throws FileNotFoundException, IOException {
+ return StandardCharsets.UTF_8;
+ }
+
+ public static Map<String, ColumnDefinition> columnDefinitionsToMap(List<ColumnDefinition> columnDefinitions) {
+ Map<String, ColumnDefinition> columnDefinitionsMap = new HashMap<>();
+ columnDefinitions.stream().forEach(c -> columnDefinitionsMap.put(c.getName(), c));
+
+ return columnDefinitionsMap;
+ }
+
+ public static Class<?> fullQualifiedNameTypeFromTypeDonnee(TypeDonnee typeDonnee) {
+ switch (typeDonnee) {
+ case NUMERIQUE:
+ return java.lang.Long.class;
+ case DATE:
+ return java.time.LocalDateTime.class;
+ case DECIMAL:
+ return java.math.BigDecimal.class;
+ default:
+ return java.lang.String.class;
+ }
+ }
+
+}
--
Gitblit v1.10.0