📄 octopusloader.java
字号:
/*
LoaderGenerator - tool for generated xml, sql and doml file needed for Octopus.
Copyright (C) 2003 Together
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.webdocwf.util.loader.wizard;
import java.io.*;
/**
* Octopus class sets the input parameters and start the process (Loader)
* @author Radoslav Dutina
* @version 1.0
*/
public class OctopusLoader {
protected WizardFrame wizard = null;
private OctopusLoaderData initData;
/**
* Construct the object of Octopus class with associated parameter
* @param initData is object of LoaderOctopusEntry which contain input parameters
*/
public OctopusLoader(OctopusLoaderData initData) {
this.initData=initData;
}
/**
* This method start the process (Loaderp)
* @return process
* @throws java.lang.Exception
*/
public String[] generateAll() throws Exception {
int exit = 0;
Process process = null;
String tmp[] = new String[27];
String as[]=null;
try{
ErrorReader errorReader;
BufferedReader buffer;
BufferedReader error;
String s;
int param = 0;
if (!initData.getLogMode().equalsIgnoreCase("")) {
tmp[param] = "-m";
param++;
tmp[param] = initData.getLogMode();
param++;
}
if (!initData.getLogFileDir().equalsIgnoreCase("")) {
tmp[param] = "-l";
param++;
tmp[param] = initData.getLogFileDir();
param++;
}
if (!initData.getLogFileName().equalsIgnoreCase("")) {
tmp[param] = "-f";
param++;
tmp[param] = initData.getLogFileName();
param++;
}
if (!initData.getRestartIndicator().equalsIgnoreCase("")) {
tmp[param] = "-r";
param++;
tmp[param] = initData.getRestartIndicator();
param++;
}
if (!initData.getUserId().equalsIgnoreCase("")) {
tmp[param] = "-u";
param++;
tmp[param] = initData.getUserId();
param++;
}
if (!initData.getVariables().equalsIgnoreCase("")) {
tmp[param] = "-v";
param++;
tmp[param] = initData.getVariables();
param++;
}
if (!initData.getVendorConf().equalsIgnoreCase("")) {
tmp[param] = "-d";
param++;
tmp[param] = initData.getVendorConf();
param++;
}
if (!initData.getOnErrorCon().equalsIgnoreCase("")) {
tmp[param] = "-e";
param++;
tmp[param] = initData.getOnErrorCon();
param++;
}
if (!initData.getAdditionalPaths().equalsIgnoreCase("")) {
tmp[param] = "-p";
param++;
tmp[param] = initData.getAdditionalPaths();
param++;
}
if (!initData.getCommitCount().equalsIgnoreCase("")) {
tmp[param] = "-c";
param++;
tmp[param] = initData.getCommitCount();
param++;
}
if (!initData.getReturnCode().equalsIgnoreCase("")) {
tmp[param] = "-rc";
param++;
tmp[param] = initData.getReturnCode();
param++;
}
if (!initData.getIncludeTables().equalsIgnoreCase("")) {
tmp[param] = "-it";
param++;
tmp[param] = initData.getIncludeTables();
param++;
}
if (!initData.getConfJarStructure().equalsIgnoreCase("")) {
tmp[param] = "-cjs";
param++;
tmp[param] = initData.getConfJarStructure();
param++;
}
if (!initData.getPathToXml().equalsIgnoreCase("")) {
tmp[param] = " ";
param++;
tmp[param] = initData.getPathToXml();
param++;
}
as=new String[param];
for (int i=0;i<param;i++){
if(!tmp[i].equalsIgnoreCase("null"))
as[i] = tmp[i];
}
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
throw new Exception(e.getMessage());
}
return as;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -