配置文件相对路径 我今天写了个ftp上传,不过配置文件的路径总是不对,希望高手帮助调下错~!配置文件在同级目录下,private static String configFile = "()";括号类的路径该怎么写?包:package com.guibin.pub; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以先ftp 上传的是不是linux呢.linux 的路径你先在root下看能否访问这个文件。如果能在回到程序里面。 《Java资源的定位方式》,参考一下吧。 //当前类的classpath的URI目录 System.out.println(FilePath.class.getResource("/")); //当前类的classpath的URI目录 System.out.println(FilePath.class.getClassLoader().getResource("")); 可以参考http://blog.csdn.net/swandragon/archive/2009/11/05/4770445.aspx private final static String EXPORT_CONFIG_PATH = "/export/config.properties";Configuration.class.getClassLoader().getResourceAsStream(EXPORT_CONFIG_PATH); private final static Stringchinese wholesalersugg_CONFIG_PATH = "/export/config.properties";Configuration.class.getClassLoader().getResourceAsStream(EXPORT_CONFIG_PATH); 二级联动查询问题 ssh框架,启动tomacat后报错,希望得到大家的帮助,多谢了! ioc 注入空值 ssh框架出的一个小问题,新手求助大侠 对于报表,你会选择哪一种软件? 关于用域名登陆 无法把用户名和密码传过去的问题 springmvc 开发 遇到问题,在线求解! jsp框架应用的问题 第一个SERVLET运行不了 郁闷哦~~~~~~~~~~~~~大家帮忙哦 关于SSH2整合jbpm的异常问题,求给力大腿来给解决一下 安装Tomcat6.0无法访问127.0.0.1:8080 xPath 怎样获取<b:listGridCol>结点的值
linux 的路径你先在root下看能否访问这个文件。如果能在回到程序里面。
System.out.println(FilePath.class.getResource("/"));
//当前类的classpath的URI目录
System.out.println(FilePath.class.getClassLoader().getResource(""));
可以参考
http://blog.csdn.net/swandragon/archive/2009/11/05/4770445.aspx
Configuration.class.getClassLoader().getResourceAsStream(EXPORT_CONFIG_PATH);
ugg_CONFIG_PATH = "/export/config.properties";
Configuration.class.getClassLoader().getResourceAsStream(EXPORT_CONFIG_PATH);