URLUtil uu = new URLUtil();
String FILE_PATH =uu.getClassPath(Attach.class);
FILE_PATH =uu.getClassPath(Attach.class);
if(FILE_PATH.indexOf("WEB-INF\\classes")>-1){
this.path= FILE_PATH.substring(0,FILE_PATH.indexOf("WEB-INF\\classes")+7)+"";
}else{
this.path = "upload";
}
package com.bean;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URL;
/**
*
* Title:URL辅助工具类
*
*
*
*
*/
public class URLUtil {
/**
*
* Description:取得当前类所在的文件
*
*/
&
阅读(575) | 评论(0) | 转发(0) |