FtpService.java 686 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
package cn.timer.api.service;

import cn.timer.api.dto.disk.FileInfoDto;
import com.jcraft.jsch.ChannelSftp;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 上传文件的实现层
 */
public interface FtpService {

    boolean createDirs(String dirPath, ChannelSftp sftp);

    /**
     * 上传文件到服务器
     * @param targetPath
     * @param files
     * @param reservedName
     * @return
     */
    List<FileInfoDto> uploadFile(String targetPath, MultipartFile[] files, boolean reservedName);

    /**
     * 删除服务器文件
     * @param targetPath
     * @return
     */
    boolean deleteFile(List<String> targetPath);
}