mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -4,8 +4,9 @@ import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.net.LocalPortGenerator;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import cn.hutool.core.util.ByteUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import com.jcraft.jsch.*;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -463,7 +464,7 @@ public class JschUtil {
|
||||
charset = CharsetUtil.UTF_8;
|
||||
}
|
||||
final ChannelExec channel = (ChannelExec) createChannel(session, ChannelType.EXEC);
|
||||
channel.setCommand(StrUtil.bytes(cmd, charset));
|
||||
channel.setCommand(ByteUtil.toBytes(cmd, charset));
|
||||
channel.setInputStream(null);
|
||||
channel.setErrStream(errStream);
|
||||
InputStream in = null;
|
||||
@@ -503,7 +504,7 @@ public class JschUtil {
|
||||
out = shell.getOutputStream();
|
||||
in = shell.getInputStream();
|
||||
|
||||
out.write(StrUtil.bytes(cmd, charset));
|
||||
out.write(ByteUtil.toBytes(cmd, charset));
|
||||
out.flush();
|
||||
|
||||
return IoUtil.read(in, charset);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.extra.servlet;
|
||||
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import cn.hutool.core.util.ByteUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ServletUtilTest {
|
||||
@Ignore
|
||||
public void writeTest() {
|
||||
final HttpServletResponse response = null;
|
||||
final byte[] bytes = StrUtil.utf8Bytes("地球是我们共同的家园,需要大家珍惜.");
|
||||
final byte[] bytes = ByteUtil.toUtf8Bytes("地球是我们共同的家园,需要大家珍惜.");
|
||||
|
||||
//下载文件
|
||||
// 这里没法直接测试,直接写到这里,方便调用;
|
||||
@@ -38,7 +38,7 @@ public class ServletUtilTest {
|
||||
@Ignore
|
||||
public void jakartaWriteTest() {
|
||||
final jakarta.servlet.http.HttpServletResponse response = null;
|
||||
final byte[] bytes = StrUtil.utf8Bytes("地球是我们共同的家园,需要大家珍惜.");
|
||||
final byte[] bytes = ByteUtil.toUtf8Bytes("地球是我们共同的家园,需要大家珍惜.");
|
||||
|
||||
//下载文件
|
||||
// 这里没法直接测试,直接写到这里,方便调用;
|
||||
|
Reference in New Issue
Block a user