Kenmegne
7 days ago 1bc8864f134272c4bf23a9b05831803a423a4771
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.megatim.apifdxweb.service.impl.camel.config;
 
import java.io.IOException;
 
/**
 *
 * @author Gabuntu
 */
public class LocalConfiguration {
 
    private final FileProperties fileProperties;
 
    public LocalConfiguration(FileProperties fileProperties) {
        this.fileProperties = fileProperties;
    }
 
    public String referentielRouteURI() throws IOException {
        return "file:" + referentielLocalPath() + "?include=.*.zip" + routeParameters();
    }
 
    public String fichierRouteURI() throws IOException {
        return "file:" + fichierLocalPath() + "?include=.*.txt" + routeParameters();
    }
 
    public String standaloneTmpRouteURI() throws IOException {
        return "file:" + standaloneTmpDir() + "?include=.*.txt" + routeParameters();
    }
 
    public String standaloneRouteURI() throws IOException {
        return "file:" + standaloneDestinationDir() + "?include=.*.txt" + routeParameters();
    }
 
    public String standaloneTmpDir() throws IOException {
        return fileProperties.properties().getProperty("fdx.api.integration-standalone-temp-dir");
    }
 
    public boolean isCorrect() throws IOException {
        return referentielLocalPath() != null
                && fichierLocalPath() != null
                && standaloneTmpDir() != null
                && standaloneDestinationDir() != null;
    }
 
    private String routeParameters() {
        return "&moveFailed=error&noop=true&readLock=changed";
    }
 
    public String referentielLocalPath() throws IOException {
        return fileProperties.properties().getProperty("fdx.api.referentiel-integration-local-path");
    }
 
    public String fichierLocalPath() throws IOException {
        return fileProperties.properties().getProperty("fdx.api.fichier-integration-local-path");
    }
 
    private String standaloneDestinationDir() throws IOException {
        return fileProperties.properties().getProperty("fdx.api.integration-standalone-destination-dir");
    }
 
}