From b3d0580439b9a00c7eb918085de1694151066004 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 16:02:49 +0000
Subject: [PATCH] rename packages
---
fdx_convert/src/main/java/com/megatim/fdxconvert/util/Utilities.java | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/fdx_convert/src/main/java/com/megatim/fdxconvert/util/Utilities.java b/fdx_convert/src/main/java/com/megatim/fdxconvert/util/Utilities.java
new file mode 100644
index 0000000..3263143
--- /dev/null
+++ b/fdx_convert/src/main/java/com/megatim/fdxconvert/util/Utilities.java
@@ -0,0 +1,61 @@
+/*
+ * 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.fdxconvert.util;
+
+import com.megatim.fdxconvert.App;
+import java.io.FileInputStream;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author ASUS
+ */
+public class Utilities {
+
+ private Utilities() {
+ }
+
+ //Mots reservés de Java
+ private final static Set<String> reservedWords = new HashSet<>(Arrays.asList("abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
+ "class", "continue", "const", "default", "do", "double", "else", "enum", "exports", "extends", "final", "finally",
+ "false", "float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "module", "native",
+ "new", "null", "package", "private", "protected", "public", "requires", "return", "short", "static", "strictfp", "super", "switch",
+ "synchronized", "this", "throw", "throws", "transient", "true", "try", "var", "void", "volatile", "while"));
+
+ public static StringBuilder validateName(String name, String libelle) {
+ StringBuilder message = new StringBuilder("");
+
+ if (reservedWords.contains(name)) {
+ message.append("\"").append(name).append("\"").append(" est un mot reservé\n");
+ }
+
+ if (!name.matches("^([a-zA-Z]|_|\\$)(\\w|\\$)*$")) {
+ message.append(libelle).append(" doit commencer par une lettre [a-zA-Z], par le signe dollar( $ ) "
+ + "ou par un trait de soulignement( _ ) et ne doit pas contenir d'espace\n");
+
+ }
+
+ return message;
+ }
+
+ public static int getNbThreads() {
+
+ Properties appProps = new Properties();
+ int nbThreads = 1;
+
+ try {
+ appProps.load(new FileInputStream("./app.properties"));
+ nbThreads = Integer.parseInt(appProps.getProperty("nbThreads"));
+ } catch (Exception ex) {
+ Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return nbThreads;
+ }
+}
--
Gitblit v1.10.0