franta-hg@2: /** franta-hg@2: * copy-image-resizer franta-hg@2: * Copyright © 2014 František Kučera (frantovo.cz) franta-hg@2: * franta-hg@2: * This program is free software: you can redistribute it and/or modify franta-hg@2: * it under the terms of the GNU General Public License as published by franta-hg@2: * the Free Software Foundation, either version 3 of the License, or franta-hg@2: * (at your option) any later version. franta-hg@2: * franta-hg@2: * This program is distributed in the hope that it will be useful, franta-hg@2: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@2: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@2: * GNU General Public License for more details. franta-hg@2: * franta-hg@2: * You should have received a copy of the GNU General Public License franta-hg@2: * along with this program. If not, see . franta-hg@2: */ franta-hg@4: package cz.frantovo.copyImageResizer.cli; franta-hg@2: franta-hg@5: import cz.frantovo.copyImageResizer.RecursiveException; franta-hg@5: import cz.frantovo.copyImageResizer.RecursiveImageResizer; franta-hg@5: import cz.frantovo.copyImageResizer.RecursiveOptions; franta-hg@5: import cz.frantovo.copyImageResizer.ResizeException; franta-hg@5: import java.util.logging.Level; franta-hg@5: import java.util.logging.Logger; franta-hg@5: franta-hg@2: /** franta-hg@2: * franta-hg@2: * @author Ing. František Kučera (frantovo.cz) franta-hg@2: */ franta-hg@3: public class CLIStarter { franta-hg@2: franta-hg@5: private static final Logger log = Logger.getLogger(CLIStarter.class.getName()); franta-hg@5: franta-hg@2: public static void main(String[] args) { franta-hg@5: franta-hg@5: try { franta-hg@5: CLIParser parser = new CLIParser(); franta-hg@5: RecursiveOptions options = parser.parseOptions(args); franta-hg@5: RecursiveImageResizer resizer = new RecursiveImageResizer(); franta-hg@5: resizer.resize(options); franta-hg@5: } catch (CLIParserException e) { franta-hg@5: log.log(Level.SEVERE, "Unable to parse CLI options", e); franta-hg@5: } catch (RecursiveException e) { franta-hg@5: log.log(Level.SEVERE, "Error while processing filesystem hierarchy", e); franta-hg@5: } catch (ResizeException e) { franta-hg@5: log.log(Level.SEVERE, "Error while resizing image", e); franta-hg@5: } franta-hg@2: } franta-hg@5: franta-hg@2: }