mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -37,12 +37,13 @@ public class MailAccount implements Serializable {
|
||||
|
||||
// System Properties
|
||||
private static final String SPLIT_LONG_PARAMS = "mail.mime.splitlongparameters";
|
||||
//private static final String ENCODE_FILE_NAME = "mail.mime.encodefilename";
|
||||
//private static final String CHARSET = "mail.mime.charset";
|
||||
|
||||
// 其他
|
||||
private static final String MAIL_DEBUG = "mail.debug";
|
||||
|
||||
/**
|
||||
* 默认mail配置查询路径
|
||||
*/
|
||||
public static final String[] MAIL_SETTING_PATHS = new String[]{"config/mail.setting", "config/mailAccount.setting", "mail.setting"};
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.extra.qrcode;
|
||||
|
||||
import cn.hutool.core.codec.BaseN.Base64;
|
||||
import cn.hutool.core.codec.binary.Base64;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.swing.img.ImgUtil;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
|
@@ -499,6 +499,7 @@ public class Sftp extends AbstractFtp {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Override
|
||||
public boolean uploadFile(final String destPath, final File file) {
|
||||
if(false == FileUtil.isFile(file)){
|
||||
@@ -521,13 +522,11 @@ public class Sftp extends AbstractFtp {
|
||||
* @param destPath 服务端路径,可以为{@code null} 或者相对路径或绝对路径
|
||||
* @param fileName 文件名
|
||||
* @param fileStream 文件流
|
||||
* @return 是否上传成功
|
||||
* @since 5.7.16
|
||||
*/
|
||||
public boolean uploadFile(String destPath, final String fileName, final InputStream fileStream) {
|
||||
public void uploadFile(String destPath, final String fileName, final InputStream fileStream) {
|
||||
destPath = StrUtil.addSuffixIfNot(destPath, StrUtil.SLASH) + StrUtil.removePrefix(fileName, StrUtil.SLASH);
|
||||
put(fileStream, destPath, null, Mode.OVERWRITE);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -105,7 +105,7 @@ public class FtpTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void existSftpTest() throws Exception {
|
||||
public void existSftpTest() {
|
||||
try (final Sftp ftp = new Sftp("127.0.0.1", 22, "test", "test")) {
|
||||
Console.log(ftp.pwd());
|
||||
Console.log(ftp.exist(null));
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.extra.qrcode;
|
||||
|
||||
import cn.hutool.core.codec.BaseN.Base64;
|
||||
import cn.hutool.core.codec.binary.Base64;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
|
@@ -27,18 +27,16 @@ public class JschUtilTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void bindRemotePort() throws InterruptedException {
|
||||
public void bindRemotePort() {
|
||||
// 建立会话
|
||||
final Session session = JschUtil.getSession("looly.centos", 22, "test", "123456");
|
||||
// 绑定ssh服务端8089端口到本机的8000端口上
|
||||
final boolean b = JschUtil.bindRemotePort(session, 8089, "localhost", 8000);
|
||||
Assert.assertTrue(b);
|
||||
// 保证一直运行
|
||||
// while (true){
|
||||
// Thread.sleep(3000);
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
@Ignore
|
||||
public void sftpTest() {
|
||||
|
Reference in New Issue
Block a user