Examples of Ftp


Examples of com.jeecms.core.entity.Ftp

  private boolean vldExist(Integer id, WebErrors errors) {
    if (errors.ifNull(id, "id")) {
      return true;
    }
    Ftp entity = manager.findById(id);
    if (errors.ifNotExist(entity, Ftp.class, id)) {
      return true;
    }
    return false;
  }
View Full Code Here

Examples of com.jeecms.core.entity.Ftp

        fileUrl = dbFileMng.storeByExt(site.getUploadPath(), ext, file
            .getInputStream());
        // 加上访问地址
        fileUrl = request.getContextPath() + dbFilePath + fileUrl;
      } else if (site.getUploadFtp() != null) {
        Ftp ftp = site.getUploadFtp();
        String ftpUrl = ftp.getUrl();
        fileUrl = ftp.storeByExt(site.getUploadPath(), ext, file
            .getInputStream());
        // 加上url前缀
        fileUrl = ftpUrl + fileUrl;
      } else {
        String ctx = request.getContextPath();
View Full Code Here

Examples of com.jeecms.core.entity.Ftp

              file.getInputStream());
          // 加上访问地址
          fileUrl = request.getContextPath() + dbFilePath + fileUrl;
        }
      } else if (site.getUploadFtp() != null) {
        Ftp ftp = site.getUploadFtp();
        String ftpUrl = ftp.getUrl();
        if (!StringUtils.isBlank(filename)
            && FilenameUtils.getExtension(filename).equals(ext)) {
          filename = filename.substring(ftpUrl.length());
          fileUrl = ftp.storeByFilename(filename, file
              .getInputStream());
        } else {
          fileUrl = ftp.storeByExt(site.getUploadPath(), ext, file
              .getInputStream());
          // 加上url前缀
          fileUrl = ftpUrl + fileUrl;
        }
      } else {
View Full Code Here

Examples of com.jeecms.core.entity.Ftp

        }
        // 加上访问地址
        String dbFilePath = site.getConfig().getDbFileUri();
        fileUrl = request.getContextPath() + dbFilePath + fileUrl;
      } else if (site.getUploadFtp() != null) {
        Ftp ftp = site.getUploadFtp();
        if (mark && isImg) {
          File tempFile = mark(uplFile, conf);
          fileUrl = ftp.storeByExt(site.getUploadPath(), ext,
              new FileInputStream(tempFile));
          tempFile.delete();
        } else {
          fileUrl = ftp.storeByExt(site.getUploadPath(), ext, uplFile
              .getInputStream());
        }
        // 加上url前缀
        fileUrl = ftp.getUrl() + fileUrl;
      } else {
        if (mark && isImg) {
          File tempFile = mark(uplFile, conf);
          fileUrl = fileRepository.storeByExt(site.getUploadPath(),
              ext, tempFile);
View Full Code Here

Examples of com.jeecms.core.entity.Ftp

          }
          // 加上访问地址
          fileUrl = request.getContextPath() + dbFilePath + fileUrl;
        }
      } else if (site.getUploadFtp() != null) {
        Ftp ftp = site.getUploadFtp();
        String ftpUrl = ftp.getUrl();
        if (!StringUtils.isBlank(filename)) {
          filename = filename.substring(ftpUrl.length());
          if (mark) {
            File tempFile = mark(file, conf);
            fileUrl = ftp.storeByFilename(filename,
                new FileInputStream(tempFile));
            tempFile.delete();
          } else {
            fileUrl = ftp.storeByFilename(filename, file
                .getInputStream());
          }
        } else {
          if (mark) {
            File tempFile = mark(file, conf);
            fileUrl = ftp.storeByExt(site.getUploadPath(), ext,
                new FileInputStream(tempFile));
            tempFile.delete();
          } else {
            fileUrl = ftp.storeByExt(site.getUploadPath(), ext,
                file.getInputStream());
          }
          // 加上url前缀
          fileUrl = ftpUrl + fileUrl;
        }
View Full Code Here

Examples of com.jeecms.core.entity.Ftp

              getLen(imgTop, imgScale),
              getLen(imgLeft, imgScale), getLen(imgWidth,
                  imgScale), getLen(imgHeight, imgScale));
          dbFileMng.restore(imgSrcPath, file);
        } else if (site.getUploadFtp() != null) {
          Ftp ftp = site.getUploadFtp();
          String ftpUrl = ftp.getUrl();
          imgSrcPath = imgSrcPath.substring(ftpUrl.length());
          File file = ftp.retrieve(imgSrcPath);
          imageScale.resizeFix(file, file, reMinWidth, reMinHeight,
              getLen(imgTop, imgScale),
              getLen(imgLeft, imgScale), getLen(imgWidth,
                  imgScale), getLen(imgHeight, imgScale));
          ftp.restore(imgSrcPath, file);
        } else {
          String ctx = request.getContextPath();
          imgSrcPath = imgSrcPath.substring(ctx.length());
          File file = fileRepository.retrieve(imgSrcPath);
          imageScale.resizeFix(file, file, reMinWidth, reMinHeight,
              getLen(imgTop, imgScale),
              getLen(imgLeft, imgScale), getLen(imgWidth,
                  imgScale), getLen(imgHeight, imgScale));
        }
      } else {
        if (site.getConfig().getUploadToDb()) {
          String dbFilePath = site.getConfig().getDbFileUri();
          imgSrcPath = imgSrcPath.substring(dbFilePath.length());
          File file = dbFileMng.retrieve(imgSrcPath);
          imageScale.resizeFix(file, file, reMinWidth, reMinHeight);
          dbFileMng.restore(imgSrcPath, file);
        } else if (site.getUploadFtp() != null) {
          Ftp ftp = site.getUploadFtp();
          String ftpUrl = ftp.getUrl();
          imgSrcPath = imgSrcPath.substring(ftpUrl.length());
          File file = ftp.retrieve(imgSrcPath);
          imageScale.resizeFix(file, file, reMinWidth, reMinHeight);
          ftp.restore(imgSrcPath, file);
        } else {
          String ctx = request.getContextPath();
          imgSrcPath = imgSrcPath.substring(ctx.length());
          File file = fileRepository.retrieve(imgSrcPath);
          imageScale.resizeFix(file, file, reMinWidth, reMinHeight);
View Full Code Here

Examples of com.jeecms.core.entity.Ftp

  private boolean vldFtpExist(Integer id, WebErrors errors) {
    if (id == null) {
      return false;
    }
    Ftp entity = ftpMng.findById(id);
    return errors.ifNotExist(entity, Ftp.class, id);
  }
View Full Code Here

Examples of developer.FTP

  @Test
  public void testConnect() {
    if(UpdateFTP.configured()){
     
      FTP ftp = new FTP();
     
      try {
        ftp.connect(host, port, user, pass);
      } catch (IOException e) {
        fail("connect fail: " + e.getMessage());
      }
     
      System.out.println("ftp connected to: " + host);
     
      try {
        ftp.disconnect();
      } catch (IOException e) {
        fail("disconnect fail: " + e.getMessage());
      }
     
      System.out.println("ftp disconnected");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.