diff --git a/.classpath b/.classpath index 7e729e64..7155d58e 100644 --- a/.classpath +++ b/.classpath @@ -2,17 +2,17 @@ - + + + - + - + - + - - diff --git a/.project b/.project index ded1f1a4..ed1fe4a2 100644 --- a/.project +++ b/.project @@ -25,6 +25,11 @@ + + com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder + + + org.eclipse.jem.workbench.JavaEMFNature diff --git a/.settings/com.genuitec.eclipse.migration.prefs b/.settings/com.genuitec.eclipse.migration.prefs new file mode 100644 index 00000000..e8679401 --- /dev/null +++ b/.settings/com.genuitec.eclipse.migration.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +performed.operation.correct.unbound.jre=1.0 diff --git a/build/classes/.gitignore b/build/classes/.gitignore new file mode 100644 index 00000000..67f303f0 --- /dev/null +++ b/build/classes/.gitignore @@ -0,0 +1,2 @@ +/com/ +/dataSystem.properties diff --git a/build/classes/com/platform/controller/DataModelController.class b/build/classes/com/platform/controller/DataModelController.class index 837dcfde..6d59835f 100644 Binary files a/build/classes/com/platform/controller/DataModelController.class and b/build/classes/com/platform/controller/DataModelController.class differ diff --git a/build/classes/com/platform/controller/DefaultController.class b/build/classes/com/platform/controller/DefaultController.class index 91940503..f975e29e 100644 Binary files a/build/classes/com/platform/controller/DefaultController.class and b/build/classes/com/platform/controller/DefaultController.class differ diff --git a/build/classes/com/platform/entities/EncodedInfoEntity.class b/build/classes/com/platform/entities/EncodedInfoEntity.class index ca2439bd..f920dc4d 100644 Binary files a/build/classes/com/platform/entities/EncodedInfoEntity.class and b/build/classes/com/platform/entities/EncodedInfoEntity.class differ diff --git a/src/com/base/BaseController.java b/src/com/base/BaseController.java new file mode 100644 index 00000000..8a6c02c2 --- /dev/null +++ b/src/com/base/BaseController.java @@ -0,0 +1,48 @@ +/** + * 文件名 : BaseController.java + * 版权 : XX科技有限公司。 + * 描述 : <描述> + * 修改时间:2016年9月7日 + * 修改内容:<修改内容> + */ +package com.base; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.ExceptionHandler; + +/** + * <一句话功能简述> + * <功能详细描述> + * @author chen + * @version [版本号,2016年9月7日] + * @see [相关类/方法] + * @since [产品/模块版本] + */ +public class BaseController { + + /** + * <一句话功能简述> 基于@ExceptionHandler异常处理----全局异常处理 + * <功能详细描述> + * @param request + * @param ex 异常 + * @return + * @see [类、类#方法、类#成员] + */ + @ExceptionHandler + public String exp(HttpServletRequest request, Exception ex) { + + request.setAttribute("ex", ex); + System.err.println("BaseController --exp "); + // 根据不同错误转向不同页面 + if(ex instanceof CustomException) { + //TODO 从新封装json + System.err.println("BaseController --exp -- CustomException "); + return "error-business"; + } else { + //TODO 其他错误则 调到指定页面 + + return "error"; + } + } +} \ No newline at end of file diff --git a/src/com/base/Constant.java b/src/com/base/Constant.java new file mode 100644 index 00000000..87bd657d --- /dev/null +++ b/src/com/base/Constant.java @@ -0,0 +1,33 @@ +package com.base; + +import java.io.File; + +/** + * @描述 常量类 + * @author chen + * @date 2016年8月30日 + * @package com.base + */ +public class Constant { + + /** 配置文件文件-dataSystem.properties */ + public static String SYSTEM_PROPERTIES_FIEL_PATH = "/com/base/dataSystem.properties"; + + /** 国际话配置文件文件-i18n.properties */ + public static String I18N_PROPERTIES_FIEL_PATH = "/com/base/i18n.properties"; + + /** 记录异常的文件-system_exception.txt-的位置-- */ + public final static String SYSTEM_EXCEPTION_FILEPATH = "\\log\\system_exception.txt"; + + + /** WritefileThread-线程睡眠时间--3000 */ + public final static long THREAD_SLEEP_WRITEFILETHREAD = 3000; + + /** 是否将异常写入文件 */ + public final static String IS_WRITE_LOGFILE = "iswritelogfile"; + + /** CustomException记录报异常的对象的对象个数--10 */ + public final static int CustomException_log_object_size = 10; + + +} diff --git a/src/com/base/Custom4exception.java b/src/com/base/Custom4exception.java new file mode 100644 index 00000000..cfbab1e6 --- /dev/null +++ b/src/com/base/Custom4exception.java @@ -0,0 +1,41 @@ +package com.base; + + +/** + * @描述 异常常量编码 + * @author chen + * @date 2016年8月22日 + * @package com.base + */ +public class Custom4exception { + //3003001001 : 第一位:标识异常, 第二到第四位:标识模块,第五道第七位:标识类别,第八道第十位标识具体异常 + /** 3:异常 + * 003:虚拟机模块 + * 001:软件依赖虚拟机资源类别 + * 001:启动异常 + */ + /** 虚拟机-资源-虚拟机VM启动异常 */ + public final static String vbox_start_exp = "3003001001"; + + /** 虚拟机-资源-虚拟机VBoxManage.exe 不存在异常 */ + public final static String vbox_exe_non_exist_exp = "3003001002"; + + /** 虚拟机-共享-设置共享文件夹中断异常 */ + public final static String share_dir_interrupted_exp = "3003002001"; + + /** 数据管理-数据上报-中断或读写异常 */ + public final static String data_manage_interrupted_exp = "3004001001"; + + /** 公共模块utils-xml类-xml非法异常 */ + public final static String xml_field_Illega_exp = "3005001001"; + + /** 公共模块utils-xml类-document异常 */ + public final static String xml_docu_exp = "3005001002"; + + /** 公共模块utils-xml类-读写异常 */ + public final static String xml_io_exp = "3005001003"; + + /** 公共模块utils-oracle类-读写异常 */ + public final static String oracle_io_exp = "3005002001"; + +} diff --git a/src/com/base/CustomException.java b/src/com/base/CustomException.java new file mode 100644 index 00000000..f9c4192c --- /dev/null +++ b/src/com/base/CustomException.java @@ -0,0 +1,112 @@ +package com.base; + + +@SuppressWarnings("serial") +public class CustomException extends Exception { + + /** 自定义异常信息-错误信息 */ + private String msg; + + /** 操作对象 */ + private Object[] objArray; + + /** 异常 */ + private Throwable cause; + + static{ + // 是否 启动 记录 异常的线程 + if (Boolean.valueOf(Resource.getProperties().get(Constant.IS_WRITE_LOGFILE))) { + //启动 记录 异常的线程 + WritefileThread wt = new WritefileThread(); + wt.start(); + } + } + + public CustomException() { + super(); + } + + /** + * @功能 将异常记录进文件 + * @param code 异常编码 + * @param msg 自定义异常信息 + * @param e + * @param obj + */ + public CustomException(String code,Exception e,Object... obj) { + super(code); + StringBuffer sbuf= new StringBuffer(); + sbuf.append(msg); + + sbuf.append(code); + sbuf.append("\r\n"); + msg = Resource.getProperties().get(code); + // 记录自定义的 异常 + if (null != msg) { + sbuf.append(msg); + sbuf.append("\r\n"); + } + // 记录原始的异常 + if (null != e) { + StackTraceElement[] array = e.getStackTrace(); + cause = e.getCause(); + for (StackTraceElement stackTraceElement : array) { + sbuf.append(stackTraceElement.toString()); + sbuf.append("\r\n"); + } + } + //记录 出现异常时 当前的对象 + if (null != obj) { + Object[] array = obj; + sbuf.append("Object[] size : "); + sbuf.append(array.length); + int forSize = 0; + if (Constant.CustomException_log_object_size < array.length) { + forSize = Constant.CustomException_log_object_size; + } + else { + forSize = array.length; + } + for (int i = 0; i < forSize; i++) { + sbuf.append(array[i]); + sbuf.append("\r\n"); + } + sbuf.append("......"); + sbuf.append("\r\n"); + } + else { + sbuf.append("null"); + sbuf.append("\r\n"); + } + + sbuf.append("\r\n"); + // 是否 写入 文件 + if (Boolean.valueOf(Resource.getProperties().get(Constant.IS_WRITE_LOGFILE))) { + WritefileThread.getStrArray().add(sbuf.toString()); + } + } + + /** + * @功能 获得msg + * @return msg + */ + public String getMsg() { + return msg; + } + + /** + * @功能 获得objArray + * @return objArray + */ + public Object[] getObjArray() { + return objArray; + } + + /** + * @功能 获得cause + * @return cause + */ + public Throwable getCause() { + return cause; + } +} diff --git a/src/com/base/FileOperate.java b/src/com/base/FileOperate.java new file mode 100644 index 00000000..718d3d4d --- /dev/null +++ b/src/com/base/FileOperate.java @@ -0,0 +1,383 @@ +package com.base; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.RandomAccessFile; +import java.nio.channels.FileLock; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import javax.swing.filechooser.FileSystemView; + +/** + * @描述 文件操作 + * @author chen + * @date 2016年8月8日 + * @package com.utils + */ +public class FileOperate { + private final static String localDiskName = "本地磁盘"; + private final static String enlocalDiskName = "Local Disk"; + private final static String CD = "CD"; + private final static String DVD = "DVD"; + public static String usbPath = ""; + + /** + * @功能 获取全部的外部移动硬盘路径 + * + * @return + */ + public static List filterDiskPath() { + FileSystemView fileSystemView = FileSystemView.getFileSystemView(); + List diskPathName = new ArrayList(); + File[] roots = File.listRoots(); + for (File file : roots) { + String diskName = fileSystemView.getSystemTypeDescription(file);// 获取磁盘的类型描述信息 + if (diskName.startsWith(localDiskName) || diskName.startsWith(enlocalDiskName) || diskName.contains(CD) + || diskName.contains(CD) || diskName.contains(DVD)) // 当磁盘为可移动磁盘时{ + continue; + diskPathName.add(file.getAbsolutePath()); + } + return diskPathName; + } + + /** + * @功能 创建文件夹 + * @param path + * 上级目录 + * @param dirName + * 待创建的目录 + * @return + */ + public static int createDir(String path, String dirName) { + File dirFile = new File(path + "\\" + dirName); + if (!dirFile.exists()) { + if (!dirFile.mkdirs()) { + System.out.println("目录不存在,创建失败!"); + return 2; + } + return 1; + } + return 0; + } + + /** + * @功能 检测数据文件是否完整 + * + * @param path + * 文件绝对路径 + * @return + */ + public static boolean isFileExists(String path) { + File file = new File(path); + if (file.exists()) + return true; + return false; + } + + /** + * @功能 文件是否存在 + * + * @param name + * 文件绝对路径 + * @return + */ + public static boolean file_dir_exist(String name) { + + try { + File file = new File(name); + if (!file.exists()) { + return false; + // return true; + } + } + catch (Exception e) { + // TODO: handle exception + return false; + } + return true; + } + + /** + * @功能 随机生成26以内的数字拼接的字符串(?什么用?) + * @param length + * 拼接次数 + * @return + */ + public static String getRandomString(int length) { // length表示生成字符串的长度 + String base = "abcdefghijklmnopqrstuvwxyz"; + Random random = new Random(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < length; i++) { + int number = random.nextInt(base.length()); + sb.append(base.charAt(number)); + } + return sb.toString(); + } + + /** + * @功能 以字符串方式读取文件内容 + * @param fiel_name + * 文件名 + * @return 字符串 + */ + public static String read_fileToStr(String fiel_name) { + String str = ""; + try { + File file = new File(fiel_name); + String lineTxt = ""; + InputStreamReader read = new InputStreamReader(new FileInputStream(file), "gbk");// 考虑到编码格式 + BufferedReader bufferedReader = new BufferedReader(read); + while ((lineTxt = bufferedReader.readLine()) != null) { + str = str + lineTxt; + } + bufferedReader.close(); + read.close(); + } + catch (Exception e) { + e.printStackTrace(); + return "Exception"; + } + return str; + } + + /** + * @功能 读取文件路径的各级目录,以数组形式返回 + * @param path_filename + * 文件或文件夹路径 + * @return 数组 + */ + public static String get_filename_from_path(String path_filename) { + String[] strings = path_filename.split("\\\\"); + + return strings[strings.length - 1]; + } + + /** + * @功能 查找dirPath目录下的所有文件 + * @param dirPath + * 目录 + * @return 所有文件数组 + */ + public static List findAllFilenameFromPath(String dirPath) { + ArrayList fileAbsolutePaths = new ArrayList<>(); + FileOperate.findFiles(dirPath, fileAbsolutePaths); + return fileAbsolutePaths; + } + + /** + * @功能 删除目录下所有文件包含文件夹 + * @param dirPath + * 目录 + * @return + */ + public static boolean delAllFileByDir(String dirPath) { + boolean flag = false; + File file = new File(dirPath); + // 判断目录或文件是否存在 + if (!file.exists()) { // 不存在返回 false + return flag; + } + else { + // 判断是否为文件 + if (file.isFile()) { // 为文件时调用删除文件方法 + return deleteFile(dirPath); + } + else { // 为目录时调用删除目录方法 + return deleteDirectory(dirPath); + } + } + } + + /** + * @功能 写文件 + * @param content + * 文件内容 + * @param filePathName + * 文件绝对路径 + */ + public static void writeFile(List content, String filePathName) { + if (null == content) { + return; + } + try { + FileWriter writer = new FileWriter(filePathName); + for (Object one : content) { + writer.write(one.toString()); + writer.write("\r\n"); + } + writer.close(); + } + catch (Exception e) { + // TODO: handle exception + // e.printStackTrace(); + } + } + + /** + * @功能 追加写入写文件 + * @param content + * @param filePathName + */ + public static void appendWriteFile(String content, String filePathName){ + File file = new File(filePathName); + if (!file.exists() || !file.isFile()) { + ArrayList list = new ArrayList<>(); + list.add("系统异常日志\n"); + writeFile(list, filePathName); + } + try { + // 打开一个随机访问文件流,按读写方式 + RandomAccessFile randomFile = new RandomAccessFile(filePathName, "rw"); + // 文件长度,字节数 + long fileLength = randomFile.length(); + // 将写文件指针移到文件尾。 + randomFile.seek(fileLength); +// randomFile.writeBytes(content); + //解决中文乱码 + randomFile.write(content.getBytes()); + randomFile.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * @功能 锁定文件 + * @param fileName + * 文件绝对路径 + */ + public static boolean islockFile(String fileName) { + Object result = null; + boolean isSuccess = true; + try { + result = tryLock(fileName); + if (null == result) { + isSuccess = false; + } + } + catch (IOException e) { + e.printStackTrace(); + isSuccess = false; + } + return isSuccess; + } + + /** + * @功能 删文件夹 + * @param dirPath + * 文件夹路径 + * @return + */ + private static boolean deleteDirectory(String dirPath) { + // 如果sPath不以文件分隔符结尾,自动添加文件分隔符 + if (!dirPath.endsWith(File.separator)) { + dirPath = dirPath + File.separator; + } + File dirFile = new File(dirPath); + // 如果dir对应的文件不存在,或者不是一个目录,则退出 + if (!dirFile.exists() || !dirFile.isDirectory()) { + return false; + } + boolean flag = true; + // 删除文件夹下的所有文件(包括子目录) + File[] files = dirFile.listFiles(); + for (int i = 0; i < files.length; i++) { + // 删除子文件 + if (files[i].isFile()) { + flag = deleteFile(files[i].getAbsolutePath()); + if (!flag) + break; + } // 删除子目录 + else { + flag = deleteDirectory(files[i].getAbsolutePath()); + if (!flag) + break; + } + } + if (!flag) + return false; + // 删除当前目录 + if (dirFile.delete()) { + return true; + } + else { + return false; + } + } + + /** + * @功能 删除文件 + * @param filePath + * 文件路径 + * @return + */ + private static boolean deleteFile(String filePath) { + boolean flag = false; + File file = new File(filePath); + // 路径为文件且不为空则进行删除 + if (file.isFile() && file.exists()) { + file.delete(); + flag = true; + } + return flag; + } + + /** + * @功能 查找dirPath目录下的所有文件 + * @param dirPath + * 目录 + * @param fileAbsolutePaths + * 所有文件数组 + * @return 所有文件数组 + */ + private static List findFiles(String dirPath, List fileAbsolutePaths) { + File file = new File(dirPath); + // 是文件时 + if (!file.isDirectory()) { + String path = file.getAbsolutePath(); + fileAbsolutePaths.add(path); + } + // 是文件夹时 + else if (file.isDirectory()) { + String[] filelist = file.list(); + if (null != filelist) { + int fileNum = filelist.length; + for (int i = 0; i < fileNum; i++) { + String tempPath = dirPath + "\\" + filelist[i]; + findFiles(tempPath, fileAbsolutePaths); + } + } + + } + return fileAbsolutePaths; + } + + /** + * @功能 锁定文件 + * @param fileName 文件绝对路径 + * @return 锁 + * @throws IOException + */ + @SuppressWarnings("resource") + private static FileLock tryLock(String fileName) throws IOException { + File lockF = new File(fileName); // 要锁的文件 + lockF.deleteOnExit(); // 指定在退出时释放锁 + RandomAccessFile file = new RandomAccessFile(lockF, "rws"); // 指定要锁的文件 + FileLock res = null; + try { + res = file.getChannel().tryLock(); // 试图取得文件的锁 + } + catch (Exception e) { // 文件被其它线程锁时抛出此异常 + file.close(); + return null; + } + return res; + } + +} diff --git a/src/com/base/Resource.java b/src/com/base/Resource.java new file mode 100644 index 00000000..deafbdae --- /dev/null +++ b/src/com/base/Resource.java @@ -0,0 +1,79 @@ +package com.base; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import com.base.Constant; + +public class Resource { + + private static Map properties = new HashMap<>(); + + static{ + // 读取 properties文件 +// readPropertiesFile(Constant.SYSTEM_PROPERTIES_FIEL_PATH); + readPropertiesFile4Chinese(Constant.I18N_PROPERTIES_FIEL_PATH); + + } + + /** + * @功能 读取配置(解决中文乱码) + * @param filename "/com/utils/exception/i18n.properties" 的格式 + */ + public static void readPropertiesFile4Chinese(String filename) { + Properties pro = new Properties(); + try { + // 读取属性文件 XXXX.properties(Reader。writer解决中文乱码) +// InputStreamReader in= new InputStreamReader(Resource.class.getClassLoader().getResourceAsStream(filename), "UTF-8"); + InputStreamReader in= new InputStreamReader(Resource.class.getResourceAsStream(filename), "UTF-8"); + BufferedReader bf = new BufferedReader(in); + // InputStreamReader in = new BufferedInputStream(new FileInputStream(filename)); + pro.load(bf); // /加载属性列表 + Iterator it = pro.stringPropertyNames().iterator(); + while (it.hasNext()) { + String key = it.next(); + properties.put(key, pro.getProperty(key)); + } + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * @功能 获得properties + * @return properties + */ + public static Map getProperties() { + return properties; + } + + /** + * @功能 读取配置 + * @param filename 文件绝对路径 + */ + public static void readPropertiesFile(String filename) { + Properties pro = new Properties(); + try { + // 读取属性文件 XXXX.properties( 中文会 乱码) + BufferedInputStream bf = new BufferedInputStream(new FileInputStream(filename)); + pro.load(bf); // /加载属性列表 + Iterator it = pro.stringPropertyNames().iterator(); + while (it.hasNext()) { + String key = it.next(); + properties.put(key, pro.getProperty(key)); + } + bf.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/com/base/WritefileThread.java b/src/com/base/WritefileThread.java new file mode 100644 index 00000000..2bd55d90 --- /dev/null +++ b/src/com/base/WritefileThread.java @@ -0,0 +1,68 @@ +package com.base; + +import java.util.ArrayList; +import java.util.List; + +import com.base.Constant; + +/** + * @描述 写入异常--进文件system_exception.txt + * @author chen + * @date 2016年8月30日 + * @package com.utils.exception + */ +public class WritefileThread extends Thread implements Runnable{ + + /** 存储异常信息 */ + private static List strArray = new ArrayList<>(); + + /** 是否继续运行 */ + private static boolean isContinue = true; + + @Override + public void run() { + super.run(); + while(isContinue){ + try { + Thread.sleep(Constant.THREAD_SLEEP_WRITEFILETHREAD); + } catch (InterruptedException e) { + e.printStackTrace(); + } + synchronized (strArray) { + //同步代码--写入日志 + String str = array2Str(strArray); +//TODO FileOperate.appendWriteFile(str, Constant.SYSTEM_EXCEPTION_FILEPATH); + strArray.clear(); + } + } + } + /** + * @功能 获得strArray + * @return strArray + */ + public static List getStrArray() { + return strArray; + } + + /** + * @功能 设置 isContinue + * @param isContinue + */ + public static void setContinue(boolean isContinue) { + WritefileThread.isContinue = isContinue; + } + + /** + * @功能 list --> String + * @param array arrayList + * @return String + */ + @SuppressWarnings("rawtypes") + private static String array2Str(List array) { + StringBuffer sbuf = new StringBuffer(); + for (Object object : array) { + sbuf.append(object); + } + return sbuf.toString(); + } +} diff --git a/src/com/base/i18n.properties b/src/com/base/i18n.properties new file mode 100644 index 00000000..e69de29b diff --git a/src/com/platform/controller/DataModelController.java b/src/com/platform/controller/DataModelController.java index eb29d94f..f555497e 100644 --- a/src/com/platform/controller/DataModelController.java +++ b/src/com/platform/controller/DataModelController.java @@ -14,6 +14,7 @@ import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import com.base.BaseController; import com.platform.entities.PagerOptions; import com.platform.service.DataInfoService; import com.platform.service.OracleStatusService; @@ -21,7 +22,7 @@ import com.platform.utils.Configs; import com.platform.utils.UtilsHelper; @Controller -public class DataModelController { +public class DataModelController extends BaseController{ @Resource(name = "dataInfoService") private DataInfoService dfs; diff --git a/src/com/platform/controller/DefaultController.java b/src/com/platform/controller/DefaultController.java index 4722c5d6..84eca9fa 100644 --- a/src/com/platform/controller/DefaultController.java +++ b/src/com/platform/controller/DefaultController.java @@ -7,10 +7,13 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import com.base.BaseController; +import com.base.CustomException; +import com.base.Resource; import com.platform.utils.Configs; @Controller -public class DefaultController { +public class DefaultController extends BaseController{ @RequestMapping("/") public ModelAndView defaultHandler(HttpServletRequest req, HttpServletResponse res){ //处理不匹配的请求 @@ -20,9 +23,15 @@ public class DefaultController { } @RequestMapping("/test") - public void test(HttpServletRequest req, HttpServletResponse res){ + public void test(HttpServletRequest req, HttpServletResponse res) throws CustomException{ //System.out.println(Class.class.getClass().getResource("/").getPath()); + new Resource(); System.out.println(Configs.EXTRACT_LOG_LOCALTION); + boolean istrue = true; + if (istrue) { + throw new CustomException("3212", null); + } + System.out.println("end"); } } diff --git a/src/com/platform/entities/EncodedInfoEntity.java b/src/com/platform/entities/EncodedInfoEntity.java index fa6b934c..27055b10 100644 --- a/src/com/platform/entities/EncodedInfoEntity.java +++ b/src/com/platform/entities/EncodedInfoEntity.java @@ -8,8 +8,10 @@ package com.platform.entities; * */ public class EncodedInfoEntity { - private String name; //名称 - private String code; //编码 + /** 名称 */ + private String name; + /** 编码 */ + private String code; public EncodedInfoEntity() {} diff --git a/test/com/test/base/ResourceTest.java b/test/com/test/base/ResourceTest.java new file mode 100644 index 00000000..6bc65160 --- /dev/null +++ b/test/com/test/base/ResourceTest.java @@ -0,0 +1,23 @@ +/** + * 文件名 : ResourceTest.java + * 版权 : XX科技有限公司。 + * 描述 : <描述> + * 修改时间:2016年9月7日 + * 修改内容:<修改内容> + */ +package com.test.base; + +import java.io.InputStream; + +import com.base.Constant; +import com.base.Resource; + +public class ResourceTest { + + public static void main(String[] args) { + Resource ss = new Resource(); + Resource.readPropertiesFile(Constant.SYSTEM_PROPERTIES_FIEL_PATH); + + } + +}