Пример #1
0
  public String deleteFile() {

    super.setPageTitle("label.media.binmanagement");
    Context ctx =
        (Context) super.getServletRequest().getSession().getAttribute(ProfileConstants.context);
    Integer merchantid = ctx.getMerchantid();
    FileModule futil = (FileModule) SpringUtil.getBean("localfile");
    futil.deleteFile(merchantid, new File(deleteFilePath));
    super.setSuccessMessage();
    return SUCCESS;
  }
Пример #2
0
  public String uploadToBin() {

    super.setPageTitle("label.media.binmanagement");

    super.getServletRequest().setAttribute("Type", this.getType());
    if (isBlank()) {
      setErrorMessage(getText("error.upload.required"));
      return INPUT;
    }
    Context ctx = super.getContext();
    Integer merchantid = ctx.getMerchantid();
    FileModule futil = (FileModule) SpringUtil.getBean("localfile");
    ContentCategoryType contentType = FileUtil.getContentCategoryType(uploadContentType);
    if (ContentCategoryType.IMAGE.equals(contentType)) {

      try {
        futil.copyFile(
            merchantid,
            "core.bin.images",
            getUpload(),
            getUploadFileName(),
            getUploadContentType());
      } catch (FileException e) {
        log.error(e);
        super.setTechnicalMessage();
        return INPUT;
      }
    } else if (ContentCategoryType.FLASH.equals(contentType)) {
      try {
        futil.copyFile(
            merchantid, "core.bin.flash", getUpload(), getUploadFileName(), getUploadContentType());
      } catch (Exception e) {
        log.error(e);
        super.setTechnicalMessage();
        return INPUT;
      }
    } else if (ContentCategoryType.FILE.equals(contentType)) {
      try {
        futil.copyFile(
            merchantid, "core.bin.files", getUpload(), getUploadFileName(), getUploadContentType());
      } catch (Exception e) {
        log.error(e);
        super.setTechnicalMessage();
        return INPUT;
      }
    } else {
      setErrorMessage(getText("error.bin.upload.invalid.type"));
      return INPUT;
    }
    super.setSuccessMessage();
    return SUCCESS;
  }
Пример #3
0
 public String displayFileBrowser() {
   super.setPageTitle("label.media.binmanagement");
   return SUCCESS;
 }
Пример #4
0
 public String binTreeDisplay() {
   super.setPageTitle("label.media.binmanagement");
   return SUCCESS;
 }