2 * Copyright (C) 2012 The Libphonenumber Authors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.google.i18n.phonenumbers.buildtools;
19 import com.google.i18n.phonenumbers.Command;
22 import java.io.IOException;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
27 * Entry point class used to invoke the generation of the binary time zone data files.
29 * @author Walter Erquinigo
30 * @author Philippe Liard
32 public class GenerateTimeZonesMapDataEntryPoint extends Command {
33 private static final Logger LOGGER = Logger.getLogger(GenerateTimeZonesMapData.class.getName());
36 public String getCommandName() {
37 return "GenerateTimeZonesMapData";
41 public boolean start() {
42 String[] args = getArgs();
44 if (args.length != 3) {
45 LOGGER.log(Level.SEVERE,
46 "usage: GenerateTimeZonesMapData /path/to/input/text_file " +
47 "/path/to/output/directory");
51 GenerateTimeZonesMapData generateTimeZonesMapData = new GenerateTimeZonesMapData(
52 new File(args[1]), new PhonePrefixDataIOHandler(new File(args[2])));
53 generateTimeZonesMapData.run();
54 } catch (IOException e) {
55 LOGGER.log(Level.SEVERE, e.getMessage());