00001
00025
package org.objectweb.cjdbc.console.text.commands;
00026
00027
import java.io.BufferedReader;
00028
import java.io.InputStreamReader;
00029
00030
import org.objectweb.cjdbc.common.i18n.ConsoleTranslate;
00031
import org.objectweb.cjdbc.console.text.module.AbstractConsoleModule;
00032
00039 public class Native extends ConsoleCommand
00040 {
00041
00047 public Native(
AbstractConsoleModule module)
00048 {
00049 super(module);
00050 }
00051
00055 public void parse(String commandText)
throws Exception
00056 {
00057
00058
00059 }
00060
00064 public String
getCommandName()
00065 {
00066
return "native";
00067 }
00068
00072 public String
getCommandDescription()
00073 {
00074
return ConsoleTranslate.get(
"console.command.native");
00075 }
00076
00080 public void execute(String commandText)
throws Exception
00081 {
00082 Runtime rt = Runtime.getRuntime();
00083 Process proc = rt.exec(commandText.trim());
00084 proc.waitFor();
00085 BufferedReader in =
new BufferedReader(
new InputStreamReader(proc
00086 .getInputStream()));
00087 String line;
00088
while ((line = in.readLine()) != null)
00089 console.
println(
ConsoleTranslate.get(
"console.command.native.output",
00090 line));
00091 }
00092 }