Exemple #1
0
  public static void publishData(WTObject object) throws Exception {
    String filePath = wtTemp + remoteDir + "/";
    try {
      if (object instanceof DataSendOrder) {
        List<WTObject> datas = getDataOrderList((DataSendOrder) object);
        for (WTObject wtObject : datas) {
          if (wtObject instanceof WTPart) { // TODO 处理WTPart是否在发放列表中
            WTPart part = (WTPart) wtObject;

            String directory = filePath + part.getNumber();
            generateXML(part, directory);

            Set<WTPart> allPart = getAllChildPart(part);
            for (WTPart wtPart : allPart) {
              generateXML(wtPart, directory);
            }

            String zipFile = directory + ".zip";
            ZipUtil.zipDir(directory, zipFile);
          }
        }
      }
    } catch (WTException e) {
      e.printStackTrace();
    }
  }
Exemple #2
0
 public static boolean sendData(WTPart part)
     throws WTException, PropertyVetoException, IOException {
   String filePath = wtTemp + remoteDir + "/";
   String directory = filePath + part.getNumber();
   generateXML(part, directory);
   String zipFile = directory + ".zip";
   ZipUtil.zipDir(directory, zipFile);
   return true;
 }