FTPClient ftpClient = new FTPSClient(); ftpClient.connect(server, port); ftpClient.login(username, password); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); ftpClient.storeFile(remoteFile, inputStream); FTPClient ftpClient = new FTPClient(); ftpClient.connect(server, port); ftpClient.login(username, password); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); ftpClient.storeFile(remoteFile, inputStream); FTPClient ftpClient = new FTPClient(); ftpClient.connect(server, port); ftpClient.login(username, password); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); ftpClient.setTrustManager(trustManager); ftpClient.storeFile(remoteFile, inputStream); JSch jsch = new JSch(); Session session = jsch.getSession(username, server, port); session.setPassword(password); session.connect(); ChannelSftp channelSftp = (ChannelSftp) session.openChannel("sftp"); channelSftp.connect(); channelSftp.put(localFile, remoteFile); channelSftp.disconnect(); session.disconnect(); JSch jsch = new JSch(); Session session = jsch.getSession(username, server, port); session.connect(); ChannelSftp channelSftp = (ChannelSftp) session.openChannel("sftp"); channelSftp.connect(); channelSftp.put(localFile, remoteFile); channelSftp.disconnect(); session.disconnect();


上一篇:
下一篇:
切换中文