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;
         }
  • 相关阅读:
    LR遇到的问题
    常用的mysql操作
    mysql操作
    土地档案管理系统架构图,ER图,用例图
    土地档案管理系统需求分析
    Load data local infile
    Lamda Expression
    Domain Logic approaches
    Spring AOP Capabilities and Goals
    python
  • 原文地址:https://www.cnblogs.com/macula7/p/1960413.html
Copyright © 2011-2022 走看看