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:

 

评分:0

我来说两句

日历

« 2024-05-10  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 54566
  • 日志数: 51
  • 建立时间: 2015-01-04
  • 更新时间: 2015-05-27

RSS订阅

Open Toolbar