Example #1
0
 // ============================================================
 // <T>解包处理。</T>
 //
 // @param pack 打包字符串
 // ============================================================
 public void unpack(String pack) {
   if (!RString.isEmpty(pack)) {
     try {
       // 解压数据
       FAttributes map = new FAttributes();
       map.unpack(pack);
       // 获得内容
       _catalog = map.get("catalog", null);
       _date = map.get("date", null);
       _code = map.get("code", null);
       _name = map.get("name", null);
       _origin = map.get("origin", null);
       _mime = map.get("mime", null);
       _size = map.getInt("size");
     } catch (Throwable throwable) {
       _catalog = null;
       _date = null;
       _code = null;
       _name = null;
       _origin = null;
       _mime = null;
       _size = 0;
       _logger.error(this, "unpack", throwable);
     }
   }
 }
Example #2
0
 // ============================================================
 // <T>打包处理。</T>
 //
 // @return 打包字符串
 // ============================================================
 public String pack() {
   FAttributes map = new FAttributes();
   map.setNvl("catalog", _catalog);
   map.setNvl("date", _date);
   map.setNvl("code", _code);
   map.setNvl("name", _name);
   map.setNvl("origin", _origin);
   map.setNvl("mime", _mime);
   map.setNvl("size", _size);
   if (map.isEmpty()) {
     return null;
   }
   return map.pack();
 }
Example #3
0
 // ============================================================
 // <T>对包字符串进行解包,获得数据内容列表。</T>
 //
 // @return 数据内容列表
 // ============================================================
 public IAttributes asAttributes() {
   FAttributes attributes = new FAttributes();
   attributes.unpack((String) _value);
   return attributes;
 }