Skip to content

Commit

Permalink
feat: debug mode for kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
FY2QEQ authored and FY2QEQ committed Jul 18, 2024
1 parent 95a9c45 commit fc46087
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package fr.insee.arc.core.service.p0initialisation.filesystem;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -68,12 +73,32 @@ private void rebuildFileSystemInEntrepot(String entrepot) throws ArcException
String dirEntrepotArchive = directories.getDirectoryEntrepotArchive();
String dirEntrepot = directories.getDirectoryEntrepotIn();


System.out.println("§§§§§§§§§§§§§§§§§§§§");
System.out.println(dirEntrepotArchive);
System.out.println(new File(dirEntrepotArchive).exists());
System.out.println(new File(dirEntrepotArchive).isDirectory());

try (Stream<Path> stream = Files.walk(Paths.get(directories.getDirectoryRoot()))) {
stream.forEach(System.out::println);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

File[] filesInDirEntrepotArchive = new File(dirEntrepotArchive).listFiles();

if (filesInDirEntrepotArchive == null)
{
return;
}

// On cherche les fichiers du répertoire d'archive qui ne sont pas dans la table
// archive
// Si on en trouve ce n'est pas cohérent et on doit remettre ces fichiers dans
// le répertoire de reception
// pour être rechargés
List<File> dirEntrepotArchiveFiles = Arrays.asList(new File(dirEntrepotArchive).listFiles());
List<File> dirEntrepotArchiveFiles = Arrays.asList(filesInDirEntrepotArchive);
// on les insere dans une table temporaires t_files
DataStorage.execQueryRegisterFilesInDatabase(connection, dirEntrepotArchiveFiles);

Expand Down

0 comments on commit fc46087

Please sign in to comment.