private void doUpload() {
    FastMap<IPCFileUploadField> destResourceMap = new FastMap<IPCFileUploadField>();
    for (IPCFileUploadField field : fufList) {
      String fileName = field.getValue().replaceAll(".*[\\\\/]", "");
      field.setEnabled(!Strings.isNullOrEmpty(fileName) && !fileName.equalsIgnoreCase("null"));
      if (field.isEnabled()) {
        destResourceMap.put(uploadDest.getPath() + "/" + fileName, field);
      } else {
        field.setEnabled(false);
      }
    }

    if (!destResourceMap.isEmpty()) {
      final ArrayList<String> ids = Lists.newArrayList(destResourceMap.keySet());
      final HasPaths dto = FS_FACTORY.pathsList().as();
      dto.setPaths(ids);
      final CheckDuplicatesCallback cb =
          new CheckDuplicatesCallback(
              ids, destResourceMap, statList, fufList, submittedForms, formList);
      drService.diskResourcesExist(dto, cb);
    }
  }
Esempio n. 2
0
 @Override
 public void setItem(String key, String data) {
   map.put(getStorageKey(key), data);
 }