📄 jahiacmdexec.java
字号:
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .//////// JahiaCmdExec//// NK 13.01.2001////package org.jahia.utils;import java.io.*;import org.jahia.exceptions.*;import org.jahia.utils.*;/** * Execute an External Command Line * * @author Khue ng */public class JahiaCmdExec { protected String m_Cmd = ""; /** * Constructor * * @param (String) cmd, the command line */ public JahiaCmdExec(String cmd) { m_Cmd = cmd; } /** * Execute the command in the current working dir * * @exception (JahiaException) on error */ public void execute() throws JahiaException { try { Process process = Runtime.getRuntime().exec(m_Cmd); } catch (Exception e) { String errMsg = "Failed executing command line " + m_Cmd ; JahiaConsole.println("JahiaCmdExec::execute()", errMsg + "\n" + e.toString()); throw new JahiaException ("JahiaCmdExec", errMsg , JahiaException.SERVICE_ERROR, JahiaException.WARNING, e); } } /** * Execute the command in a specified working dir * * @param (File) workingDir , The abstract File object to the new working dir * @exception (JahiaException) on error */ public void execute(File workingDir) throws JahiaException { try { Process process = Runtime.getRuntime().exec(m_Cmd,new String[]{""},workingDir); } catch (Exception e) { String errMsg = "Failed executing command line " + m_Cmd ; JahiaConsole.println("JahiaCmdExec::execute()", errMsg + "\n" + e.toString()); throw new JahiaException ("JahiaCmdExec", errMsg , JahiaException.SERVICE_ERROR, JahiaException.WARNING, e); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -