zoukankan      html  css  js  c++  java
  • java获取类文件所在目录

    public static String getClassPath()
         {
                 String strClassName = testPath.class.getName();
                 String strClassFileName = strClassName.substring(strClassName
                                 .lastIndexOf(".") + 1, strClassName.length());
                 URL url = null;
                 url = testPath.class.getResource(strClassFileName + ".class");
                 String strURL = url.toString();
                 strURL = strURL.substring(strURL.indexOf('/') + 1);
                 boolean isWin = false;
                 int index = strURL.indexOf(":");
                 if (index > 0)
                         isWin = true;
                 if (!isWin)
                         return "/" + strURL;
                 return strURL;
         }
  • 相关阅读:
    http缓存机制与原理
    BFC与浮动
    05ICMP协议与ARP协议(IP协议中重要协议)
    04IP编址(网络层)
    03以太网帧结构(链路层 IEEE802.3)
    02传输介质简介
    shell 脚本 2
    shell 脚本 1
    shell 中时间 表达
    sed 行编辑器
  • 原文地址:https://www.cnblogs.com/macula7/p/1960413.html
Copyright © 2011-2022 走看看