blob: 72e9468fc1a45e753880b6eaea0173decf87561d [file] [log] [blame]
hebastaa66693a2020-07-19 16:51:28 +02001/**
2 *
3 * @author helge
4 *
5 * Class to define the constants of the export web service,
6 * like the maximum hits to be exported
7 *
8 */
9package de.ids_mannheim.korap.plkexport;
10
Akronc931cd02020-09-15 10:54:17 +020011import java.io.*;
12import java.lang.String;
13import java.util.Properties;
14
hebastaa66693a2020-07-19 16:51:28 +020015public class ExWSConf {
Akron62d90a32020-11-18 20:45:38 +010016
hebasta2e431202020-11-02 10:00:26 +010017 // Version of Export Plugin
hebasta541e6762020-07-22 20:01:53 +020018 public static final int VERSION_MAJOR = 0;
19 public static final int VERSION_MINOR = 1;
Akron91077492020-10-02 17:52:24 +020020 public static final int VERSION_PATCHLEVEL= 1;
Akronc931cd02020-09-15 10:54:17 +020021
22 private static Properties prop;
23
24 // Load properties from file
25 public static Properties properties (String propFile) {
26
27 if (prop != null)
28 return prop;
29
30 if (propFile == null)
31 propFile = "exportPlugin.conf";
32
33 InputStream iFile;
34 try {
35 iFile = new FileInputStream(propFile);
36 prop = new Properties();
37 prop.load(iFile);
38 }
39 catch (IOException t) {
40 try {
41 iFile = ExWSConf.class.getClassLoader()
42 .getResourceAsStream(propFile);
43
44 if (iFile == null) {
45 System.err.println("Unable to load properties.");
46 return null;
47 };
48
49 prop = new Properties();
50 prop.load(iFile);
51 iFile.close();
52 }
53 catch (IOException e) {
54 System.err.println(e.getLocalizedMessage());
55 return null;
56 };
57 };
58 return prop;
59 };
hebastaa66693a2020-07-19 16:51:28 +020060}