zoukankan      html  css  js  c++  java
  • atitit.基于bat cli的插件管理系统.doc

    atitit.基于bat cli的插件管理系统.doc

     

     

    /AtiPlatf/src_atibrow/com/attilax/cmd/CmdX.java

     

    pathx.isWebPathMode=true;

    String bat=pathx.classPathParent()+"/other/del_indexs.bat";

    bat=bat.replace("/""\");

    String cmd=" cmd.exe /c ""+bat+""";

    System.out.println(cmd);

    String r=exe(cmd);

    System.out.println("----echo:"+r);

    System.out.println("--f");

     

    作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

    转载请注明来源: http://blog.csdn.net/attilax

     

     

    public static String exe(String cmd) {

    try {

    String r = "";

    // 执行 CMD 命令

    Process process = Runtime.getRuntime().exec(cmd);

    //System.out.println("--echo stdin info:");

    r = echoCmdResult_asStr(process.getInputStream());

    //System.out.println("--echo err info:");

    r = r + " " + echoCmdResult_asStr(process.getErrorStream());

     

    //System.out.println("cmd ext finish!");

    return r;

    catch (Exception e) {

    throw new RuntimeException(e);

    }

     

    }

     

     

     

    private static String echoCmdResult_asStr(InputStream cmdStream)

     

    {

    String r="";

     

     

    BufferedReader reader = null;

    // BufferedReader reader;

    InputStreamReader inputStreamReader;

    try {

    inputStreamReader = new InputStreamReader(cmdStream,

    "gbk");

    catch (UnsupportedEncodingException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    throw new RuntimeException(e);

    }

    reader = new BufferedReader(inputStreamReader);

    String line = null;

    try {

    line = reader.readLine();

    catch (IOException e1) {

    // TODO Auto-generated catch block

    e1.printStackTrace();

    }

     

    while (line != null) {

    //System.out.println(line);

    r=r+" "+line;

    try {

    line = reader.readLine();

    catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

    if (reader != null) {

    try {

    reader.close();

    catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

     return r;

    }

    Cank

    atitit.插件体系设计总结o73.doc - attilax的专栏 博客频道 - CSDN.NET.htm

    Atitit 插件机制原理与设计微内核 c# java 的实现attilax总结 - attilax的专栏 博客频道 - CSDN.NET.htm

  • 相关阅读:
    阅读笔记——字节跳动公司的“字节范儿”
    阅读笔记——今日头条的人才机制
    对老师的评价及个人建议
    个人加分项
    阅读笔记——字节跳动创始人张一鸣的发展经历
    观影数据集之大数据分析
    阅读笔记
    谷粒商城分布式高级(八)—— 缓存SpringCache
    谷粒商城分布式高级(二)—— ElasticSearch全文检索
    谷粒商城分布式高级(五)—— 性能压测(压力测试 & 性能监控 & nginx动静分离 )
  • 原文地址:https://www.cnblogs.com/attilax/p/5963482.html
Copyright © 2011-2022 走看看