I'm who I am .
JSON
上一篇 /
下一篇 2015-01-15 12:55:40
/ 个人分类:java
//-----------------------------JSONObject------------------------------------------------
/**
* 获取json对象
* @return
*/
public static String getJson(){
File file = new File(filePath);
byte[] size = gZip(getBytesFromFile(file));
// System.out.println("文件的内容"+new String(size));
JSONObject jsonObj = new JSONObject();
jsonObj.put("name", filePath.substring(filePath.lastIndexOf("\\")+1,filePath.lastIndexOf(".")));
jsonObj.put("filetype", filePath.substring(filePath.lastIndexOf(".")+1));
jsonObj.put("type","");
jsonObj.put("attachsourcecode", "yf1983");
jsonObj.put("size",size);
jsonObj.put("gzip","true");
jsonObj.put("url","true");
//System.out.println("传入的json字符串:"+jsonObj.toString());
return jsonObj.toString();
}
收藏
举报
TAG: