DANCE WITH JAVA

          開(kāi)發(fā)出高質(zhì)量的系統(tǒng)

          常用鏈接

          統(tǒng)計(jì)

          積分與排名

          好友之家

          最新評(píng)論

          getPath

          web service get path : servlet or jsp? .get context()
          cmd app program get path : make a class like this, get path via itself
          ?
          package common;
          import java.net.URL;
          ?

          public class Path {
          ?public static final String CLASS_PATH;
          ?static{
          ??URL resource = Path.class.getResource("Path.class");
          ??String classPath = resource.getPath();
          ??String className = Path.class.getName().replace('.', '/')
          ????+ ".class";
          ??String classesPath = classPath.substring(0, classPath
          ????.indexOf(className));
          ??if(System.getProperty("os.name").toUpperCase().indexOf("WINDOWS")!=-1&&classesPath.startsWith("/")){
          ???classesPath=classesPath.substring(1);
          ??}
          ??CLASS_PATH=classesPath;
          ?}
          }

          posted on 2006-09-20 22:11 dreamstone 閱讀(231) 評(píng)論(0)  編輯  收藏 所屬分類: 片段

          主站蜘蛛池模板: 台东市| 海安县| 华池县| 城步| 清流县| 咸丰县| 红安县| 绵阳市| 仁寿县| 亚东县| 濮阳县| 栾城县| 遵义市| 平南县| 宁安市| 太保市| 宝丰县| 塔河县| 阿拉尔市| 石棉县| 营口市| 长宁县| 南皮县| 永川市| 航空| 沂源县| 安宁市| 新沂市| 新乡县| 金寨县| 南陵县| 高邮市| 汝阳县| 高密市| 旌德县| 广德县| 永靖县| 德庆县| 瑞昌市| 新平| 万源市|