X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.gis%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fgpsbabel%2FGpsBabelCall.java;fp=runtime%2Forg.argeo.slc.support.gis%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fgpsbabel%2FGpsBabelCall.java;h=0000000000000000000000000000000000000000;hb=2b5515c174921dc5d5c9159aa4b2c1e02f04c1e1;hp=c335eddfd91c52fd431fec1f215f53b15e662214;hpb=eef4888d3214ab92c5df3768d08c3e26269cc429;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.gis/src/main/java/org/argeo/slc/gpsbabel/GpsBabelCall.java b/runtime/org.argeo.slc.support.gis/src/main/java/org/argeo/slc/gpsbabel/GpsBabelCall.java deleted file mode 100644 index c335eddfd..000000000 --- a/runtime/org.argeo.slc.support.gis/src/main/java/org/argeo/slc/gpsbabel/GpsBabelCall.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2010 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.argeo.slc.gpsbabel; - -import java.util.ArrayList; -import java.util.List; - -import org.argeo.slc.SlcException; -import org.argeo.slc.core.execution.tasks.SystemCall; -import org.springframework.beans.factory.InitializingBean; - -public class GpsBabelCall extends SystemCall implements InitializingBean { - private String executable = "/usr/bin/gpsbabel"; - private String inputFormat; - private String inputFile; - private String outputFormat; - private String outputFile; - - public GpsBabelCall() { - super(); - } - - public GpsBabelCall(String inputFormat, String inputFile, - String outputFormat, String outputFile) { - super(); - this.inputFormat = inputFormat; - this.inputFile = inputFile; - this.outputFormat = outputFormat; - this.outputFile = outputFile; - try { - afterPropertiesSet(); - } catch (Exception e) { - throw new SlcException("Cannot configure gpsbabel call", e); - } - } - - public void afterPropertiesSet() throws Exception { - List command = new ArrayList(); - command.add(executable); - command.add("-i"); - command.add(inputFormat); - command.add("-f"); - command.add(inputFile); - command.add("-o"); - command.add(outputFormat); - command.add("-F"); - command.add(outputFile); - setCommand(command); - - setStdOutLogLevel(LOG_STDOUT); - setExceptionOnFailed(true); - } - - public final static void main(String[] args) { - String output = new GpsBabelCall("garmin,get_posn", "usb:", "csv", "-") - .function(); - System.out.println("output='" + output + "'"); - } -}