This commit is contained in:
Looly 2020-10-27 18:14:18 +08:00
parent b3d2f7a94f
commit e7613143d8
5 changed files with 39 additions and 12 deletions

View File

@ -10,6 +10,7 @@
* 【core 】 Ganzhi增加方法issue#1186@Github * 【core 】 Ganzhi增加方法issue#1186@Github
* 【core 】 CollUtil增加forEach重载issue#I22NA4@Gitee * 【core 】 CollUtil增加forEach重载issue#I22NA4@Gitee
* 【core 】 CollUtil.map忽略空值改规则为原数组中的元素和处理后的元素都会忽略空值issue#I22N08@Gitee * 【core 】 CollUtil.map忽略空值改规则为原数组中的元素和处理后的元素都会忽略空值issue#I22N08@Gitee
* 【http 】 增加SoapClient增加addSOAPHeader重载
### Bug修复 ### Bug修复
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------

View File

@ -68,7 +68,7 @@ public class Img implements Serializable {
* 从Path读取图片并开始处理 * 从Path读取图片并开始处理
* *
* @param imagePath 图片文件路径 * @param imagePath 图片文件路径
* @return {@link Img} * @return Img
*/ */
public static Img from(Path imagePath) { public static Img from(Path imagePath) {
return from(imagePath.toFile()); return from(imagePath.toFile());
@ -78,7 +78,7 @@ public class Img implements Serializable {
* 从文件读取图片并开始处理 * 从文件读取图片并开始处理
* *
* @param imageFile 图片文件 * @param imageFile 图片文件
* @return {@link Img} * @return Img
*/ */
public static Img from(File imageFile) { public static Img from(File imageFile) {
return new Img(ImgUtil.read(imageFile)); return new Img(ImgUtil.read(imageFile));
@ -88,7 +88,7 @@ public class Img implements Serializable {
* 从资源对象中读取图片并开始处理 * 从资源对象中读取图片并开始处理
* *
* @param resource 图片资源对象 * @param resource 图片资源对象
* @return {@link Img} * @return Img
* @since 4.4.1 * @since 4.4.1
*/ */
public static Img from(Resource resource) { public static Img from(Resource resource) {
@ -99,7 +99,7 @@ public class Img implements Serializable {
* 从流读取图片并开始处理 * 从流读取图片并开始处理
* *
* @param in 图片流 * @param in 图片流
* @return {@link Img} * @return Img
*/ */
public static Img from(InputStream in) { public static Img from(InputStream in) {
return new Img(ImgUtil.read(in)); return new Img(ImgUtil.read(in));
@ -109,7 +109,7 @@ public class Img implements Serializable {
* 从ImageInputStream取图片并开始处理 * 从ImageInputStream取图片并开始处理
* *
* @param imageStream 图片流 * @param imageStream 图片流
* @return {@link Img} * @return Img
*/ */
public static Img from(ImageInputStream imageStream) { public static Img from(ImageInputStream imageStream) {
return new Img(ImgUtil.read(imageStream)); return new Img(ImgUtil.read(imageStream));
@ -119,7 +119,7 @@ public class Img implements Serializable {
* 从URL取图片并开始处理 * 从URL取图片并开始处理
* *
* @param imageUrl 图片URL * @param imageUrl 图片URL
* @return {@link Img} * @return Img
*/ */
public static Img from(URL imageUrl) { public static Img from(URL imageUrl) {
return new Img(ImgUtil.read(imageUrl)); return new Img(ImgUtil.read(imageUrl));
@ -129,7 +129,7 @@ public class Img implements Serializable {
* 从Image取图片并开始处理 * 从Image取图片并开始处理
* *
* @param image 图片 * @param image 图片
* @return {@link Img} * @return Img
*/ */
public static Img from(Image image) { public static Img from(Image image) {
return new Img(ImgUtil.toBufferedImage(image)); return new Img(ImgUtil.toBufferedImage(image));

View File

@ -71,11 +71,11 @@ public class ImgUtilTest {
} }
@Test @Test
@Ignore // @Ignore
public void pressTextTest() { public void pressTextTest() {
ImgUtil.pressText(// ImgUtil.pressText(//
FileUtil.file("d:/test/617180969474805871.jpg"), // FileUtil.file("d:/test/2.jpg"), //
FileUtil.file("d:/test/test2_result.png"), // FileUtil.file("d:/test/2_result.png"), //
"版权所有", Color.RED, // "版权所有", Color.RED, //
new Font("黑体", Font.BOLD, 100), // new Font("黑体", Font.BOLD, 100), //
0, // 0, //

View File

@ -322,6 +322,31 @@ public class SoapClient extends HttpBase<SoapClient> {
return ele; return ele;
} }
/**
* 增加SOAP头信息方法返回{@link SOAPHeaderElement}可以设置具体属性和子节点
*
* @param localName 头节点名称
* @return {@link SOAPHeaderElement}
* @since 5.4.7
*/
public SOAPHeaderElement addSOAPHeader(String localName) {
return addSOAPHeader(new QName(localName));
}
/**
* 增加SOAP头信息方法返回{@link SOAPHeaderElement}可以设置具体属性和子节点
*
* @param localName 头节点名称
* @param value 头节点的值
* @return {@link SOAPHeaderElement}
* @since 5.4.7
*/
public SOAPHeaderElement addSOAPHeader(String localName, String value) {
final SOAPHeaderElement soapHeaderElement = addSOAPHeader(localName);
soapHeaderElement.setTextContent(value);
return soapHeaderElement;
}
/** /**
* 增加SOAP头信息方法返回{@link SOAPHeaderElement}可以设置具体属性和子节点 * 增加SOAP头信息方法返回{@link SOAPHeaderElement}可以设置具体属性和子节点
* *
@ -329,7 +354,7 @@ public class SoapClient extends HttpBase<SoapClient> {
* @return {@link SOAPHeaderElement} * @return {@link SOAPHeaderElement}
* @since 5.4.4 * @since 5.4.4
*/ */
public SOAPHeaderElement addSOAPHeader(QName name){ public SOAPHeaderElement addSOAPHeader(QName name) {
SOAPHeaderElement ele; SOAPHeaderElement ele;
try { try {
ele = this.message.getSOAPHeader().addHeaderElement(name); ele = this.message.getSOAPHeader().addHeaderElement(name);

View File

@ -66,7 +66,7 @@ public class WorkbookUtil {
} }
if (excelFile.exists()) { if (excelFile.exists()) {
return createBook(FileUtil.getInputStream(excelFile), true); return createBook(FileUtil.getInputStream(excelFile));
} }
return createBook(StrUtil.endWithIgnoreCase(excelFile.getName(), ".xlsx")); return createBook(StrUtil.endWithIgnoreCase(excelFile.getName(), ".xlsx"));
@ -95,6 +95,7 @@ public class WorkbookUtil {
* @return {@link Workbook} * @return {@link Workbook}
* @deprecated 使用完毕无论是否closeAfterReadpoi会关闭流此参数无意义请使用{@link #createBook(InputStream)} * @deprecated 使用完毕无论是否closeAfterReadpoi会关闭流此参数无意义请使用{@link #createBook(InputStream)}
*/ */
@Deprecated
public static Workbook createBook(InputStream in, boolean closeAfterRead) { public static Workbook createBook(InputStream in, boolean closeAfterRead) {
return createBook(in, null); return createBook(in, null);
} }