奇怪个别 jar aliyun maven mirror 没有 ,但是 apache maven 有 2020年10月27日 | Leave a comment 问题: 解决: 只能暂时禁用 aliyun mirror , 应该是jar 太新了… Read More
旋转图片 2020年10月24日 | Leave a comment 解决: static BufferedImage rotateImg90(BufferedImage image, boolean left) { var ret = new BufferedImage(image.getHeight(), image.getWidth(), image.getType()); Graphics2D g2d = (Graphics2D) ret.getGraphics(); double rotationRequired = Math.toRadians(left ? 90 : -90); double locationX = image.getWidth() / 2; double locationY = image.getHeight() / 2; AffineTransform tx = AffineTransform.getRotateInstance(rotationRequired, locationX, locationY); AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR); g2d.drawImage(image, op, 0, 0); g2d.dispose(); return ret; } 123456789101112 static BufferedImage rotateImg90(BufferedImage image, boolean left) { var ret = new BufferedImage(image.getHeight(), image.getWidth(), image.getType()); Graphics2D g2d = (Graphics2D) ret.getGraphics(); double rotationRequired = Math.toRadians(left ? 90 : -90); double locationX = image.getWidth() / 2; double locationY = image.getHeight() / 2; AffineTransform tx = AffineTransform.getRotateInstance(rotationRequired, locationX, locationY); AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR); g2d.drawImage(image, op, 0, 0); g2d.dispose(); return ret; } 注意 … Read More
Quarkus JAX-RS 上传文件 2020年10月22日 | Leave a comment 问题: 解决: public final static class Form1 { @PartType(MediaType.APPLICATION_OCTET_STREAM) @FormParam("file") public InputStream f; } @POST @Consumes(MediaType.MULTIPART_FORM_DATA) public ArticleAttachment upload(@QueryParam("articleId") int articleId, @MultipartForm Form1 form1) throws IOException { System.out.println("articleId:" + articleId); final byte[] d = form1.f.readAllBytes(); System.out.println("f:" + d.length); final File file = new File("a.jpg"); System.out.println("file:" + file.getAbsolutePath()); IOUtils.write(d, new FileOutputStream(file)); return null; } 1234567891011121314151617 public final static class Form1 { @PartType(MediaType.APPLICATION_OCTET_STREAM) @FormParam("file") public InputStream f; } @POST @Consumes(MediaType.MULTIPART_FORM_DATA) public ArticleAttachment upload(@QueryParam("articleId") int articleId, @MultipartForm Form1 form1) throws IOException { System.out.println("articleId:" + articleId); final byte[] d = form1.f.readAllBytes(); System.out.println("f:" + d.length); final File file = new File("a.jpg"); System.out.println("file:" + file.getAbsolutePath()); IOUtils.write(d, new FileOutputStream(file)); return null; } … Read More
jbang 演示,jshell 的替代品,把 Java 当作脚本执行 2020年10月13日 | Leave a comment 问题: 解决: jbang 比 jshell 好 可以直接引入 maven 依赖 … Read More
【转】在CentOS 7上切换默认的java版本 2020年10月8日 | Leave a comment https://www.cnblogs.com/awpatp/p/13129899.html sudo upd… Read More
feign + jaxrs2 体验 2020年9月26日 | Leave a comment 感觉不太靠谱 没找到良好的文档,关键容易不适配(服务器与客户端有一样的定义,出现参数无法传) @… Read More
转: SAML IDP 2020年9月15日 | Leave a comment https://docs.aws.amazon.com/IAM/latest/UserGuide/id_rol… Read More
macos Netbeans 12 配置 java home 2020年8月31日 | Leave a comment 问题 解决: 修改 /Applications/NetBeans/Apache NetBeans… Read More