OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Rev 182 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 174
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.utils;
14
 package org.openconcerto.utils;
15
 
15
 
16
import java.io.IOException;
16
import java.io.IOException;
-
 
17
import java.io.OutputStream;
-
 
18
import java.nio.file.Files;
-
 
19
import java.nio.file.Path;
17
import java.util.Map;
20
import java.util.Map;
18
import java.util.Properties;
21
import java.util.Properties;
19
 
22
 
20
/**
23
/**
21
 * Useful for defining product wide values, like version, from a property file.
24
 * Useful for defining product wide values, like version, from a property file.
Line 155... Line 158...
155
 
158
 
156
    public final String getVersion() {
159
    public final String getVersion() {
157
        return this.getProperty(VERSION);
160
        return this.getProperty(VERSION);
158
    }
161
    }
159
 
162
 
-
 
163
    public final void store(final Path p) throws IOException {
-
 
164
        try (final OutputStream out = Files.newOutputStream(p)) {
-
 
165
            this.getProps().store(out, this.getClass().getName());
-
 
166
        }
-
 
167
    }
-
 
168
 
160
    @Override
169
    @Override
161
    public String toString() {
170
    public String toString() {
162
        return this.getClass().getSimpleName() + " for " + getName() + " " + getVersion();
171
        return this.getClass().getSimpleName() + " for " + getName() + " " + getVersion();
163
    }
172
    }
164
}
173
}