14 |
import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException; |
import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException; |
15 |
|
|
16 |
public class Lookup { |
public class Lookup { |
17 |
|
|
18 |
|
static final String CONFIG_FILENAME = "fulddaekning.properties"; |
19 |
|
|
20 |
static int max_workers; |
static int max_workers; |
21 |
static boolean verbose; |
static boolean verbose; |
22 |
|
|
23 |
static Properties conf; |
static SafeProperties conf; |
24 |
static Logger logger = Logger.getLogger( Lookup.class.toString() ); |
static Logger logger = Logger.getLogger( Lookup.class.toString() ); |
25 |
|
|
26 |
int postnr; |
int postnr; |
158 |
|
|
159 |
public static void main(String[] args) throws Exception { |
public static void main(String[] args) throws Exception { |
160 |
|
|
161 |
File confFile = new File("fulddaekning.properties"); |
File confFile = new File( CONFIG_FILENAME ); |
162 |
if (! confFile.exists() ) { |
if (! confFile.exists() ) { |
163 |
logger.warning("Config file not found"); |
logger.warning("Config file not found: " + CONFIG_FILENAME); |
164 |
System.exit(1); |
System.exit(1); |
165 |
} |
} |
166 |
|
|
167 |
conf = new Properties(); |
conf = new SafeProperties(); |
168 |
conf.load( new FileReader(confFile) ); |
conf.load( new FileReader(confFile) ); |
169 |
|
|
170 |
max_workers = Integer.parseInt( conf.getProperty("MAX_WORKERS") ); |
max_workers = Integer.parseInt( conf.getSafeProperty("MAX_WORKERS") ); |
171 |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
172 |
|
|
173 |
verbose = Boolean.parseBoolean( conf.getProperty("VERBOSE") ); |
verbose = Boolean.parseBoolean( conf.getSafeProperty("VERBOSE") ); |
174 |
logger.info("Starting with VERBOSE:" + verbose); |
logger.info("Starting with VERBOSE:" + verbose); |
175 |
|
|
176 |
Database db = new Database(conf); |
Database db = new Database(conf); |