01: /******************************************************************************
02: * Copyright (C) Lars Ivar Almli. All rights reserved. *
03: * ---------------------------------------------------------------------------*
04: * This file is part of MActor. *
05: * *
06: * MActor is free software; you can redistribute it and/or modify *
07: * it under the terms of the GNU General Public License as published by *
08: * the Free Software Foundation; either version 2 of the License, or *
09: * (at your option) any later version. *
10: * *
11: * MActor is distributed in the hope that it will be useful, *
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14: * GNU General Public License for more details. *
15: * *
16: * You should have received a copy of the GNU General Public License *
17: * along with MActor; if not, write to the Free Software *
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19: ******************************************************************************/package org.mactor.framework.commandexecutors;
20:
21: import org.mactor.framework.MactorException;
22:
23: public class FactoryUtil {
24: public static final String JAVA = "java";
25: public static final String SHELL = "shell";
26: public static final String SQL = "sql";
27: public static final String SEQUENCE = "sequence";
28:
29: public static String[] parseCommand(String command)
30: throws MactorException {
31: String[] parsed = new String[2];
32: int split = command.indexOf(":");
33: if (split < 0 || split + 2 >= command.length())
34: throw new MactorException("Unparseable command string '"
35: + command + "'");
36: parsed[0] = command.substring(0, split);
37: parsed[1] = command.substring(split + 1, command.length());
38: return parsed;
39: }
40: }
|