Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Ajout de logs sur FichierProcessor #51

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class LignesFichierProcessor implements ItemProcessor<LigneFichierDto, Li
private final StrategyFactory strategyFactory;
private final ProxyRetry proxyRetry;
private final ReferenceService referenceService;
private FichierSauvegardeSuppTxt fichierSauvegardeSuppTxt;
private FichierSauvegardeSuppTxt fichierSauvegardeSuppTxt;
private FichierSauvegardeSuppCsv fichierSauvegardeSuppcsv;

private Demande demande;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import fr.abes.item.core.service.ReferenceService;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.io.BufferedWriter;
Expand All @@ -22,6 +23,7 @@
@Setter
@Getter
@Component
@Slf4j
public class FichierSauvegardeSuppCsv extends AbstractFichier implements Fichier {

private final ReferenceService referenceService;
Expand All @@ -31,6 +33,7 @@ public FichierSauvegardeSuppCsv(ReferenceService referenceService) {
}

public void writePpnInFile(String ppn, Exemplaire exemplaire) throws StorageException {
log.debug("Ecriture du fichier sur chemin: " + this.getPath().resolve(this.getFilename()));
try (FileWriter fw = new FileWriter(this.getPath().resolve(this.getFilename()).toString(), true);
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter out = new PrintWriter(bw)) {
Expand All @@ -42,7 +45,6 @@ public void writePpnInFile(String ppn, Exemplaire exemplaire) throws StorageExce
} catch (IOException ex) {
throw new StorageException("Impossible d'écrire dans le fichier de sauvegarde txt");
}

}

public String gererZones(List<String> listeZonesEtSousZones, Exemplaire exemplaire) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import fr.abes.item.core.exception.StorageException;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.io.BufferedWriter;
Expand All @@ -19,9 +20,11 @@
@Setter
@Getter
@Component
@Slf4j
public class FichierSauvegardeSuppTxt extends AbstractFichier implements Fichier {

public void writePpnInFile(String ppn, Exemplaire exemplaire) throws StorageException {
log.info("Ecriture du fichier sur chemin: " + this.getPath().resolve(this.getFilename()));
try (FileWriter fw = new FileWriter(this.getPath().resolve(this.getFilename()).toString(), true);
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter out = new PrintWriter(bw)) {
Expand Down
Loading