代码改变世界

随笔分类 -  java

java
c 中openssl aes 加密对应java 方法
摘要:public static byte[] Encrypt(byte[] bArr, byte[] bArr2) { try { SecretKey generateSecret = SecretKeyFactory.getInstance("DESede").generateSecret(new D 阅读全文

posted @ 2022-03-25 17:17 Captain林 阅读(115) 评论(0) 推荐(0)

rsa 加密后 Java使用 私钥解密
摘要:A:建议使用openssl 来生成rsa pkcs1 2048格式的公私钥。例如可使用:openssl genrsa -out private.pem 2048 来生成私钥,并使用openssl rsa -in private.pem -pubout -out public.pem从私钥来产生公钥。 阅读全文

posted @ 2022-01-20 11:00 Captain林 阅读(620) 评论(0) 推荐(0)

redis lock 和 tryLock 实际使用区别
摘要:1、返回值 lock 是voidtryLock 返回bool 2、时机 lock一直等锁释放 tryLock 返回true立即 或者waittime后false 3、实例 1、 lock.lock(10, TimeUnit.SECONDS); 间隔小于租期10s的时候,连续发送两次请求,第一个请求大 阅读全文

posted @ 2021-12-03 16:58 Captain林 阅读(3821) 评论(0) 推荐(0)

pdfbox 识别 pdf为excel
摘要:1、继承 PageDrawer 和 PDFRenderer获得文本框坐标 2、通过坐标获取文字 3、通过easyExcel生成表格 public class MyPageDrawer extends PageDrawer { static final List<Coordinate> COORDIN 阅读全文

posted @ 2021-01-19 15:02 Captain林 阅读(993) 评论(0) 推荐(0)

springboot 重复提交
摘要:@Target(ElementType.METHOD)@Retention(RetentionPolicy.RUNTIME)@Documented@Inheritedpublic @interface DuplicateSubmitToken { String key() default "";} 阅读全文

posted @ 2020-12-29 11:03 Captain林 阅读(402) 评论(0) 推荐(0)

java 工具类 复制文件目录 批量修改替换文件
摘要:import java.io.*;public class moveMain { public static void main(String[] args) throws Exception {// String path="G:\\ideaWorkspace\\tzlion-data-platf 阅读全文

posted @ 2020-04-14 10:36 Captain林 阅读(1005) 评论(0) 推荐(0)

java 打包jar问题 含资源文件
摘要:1 pom 文件 maven-assembly-plugin jar-with-dependencies tzzxtest.tmImageImport.App ... 阅读全文

posted @ 2019-09-25 17:20 Captain林 阅读(870) 评论(0) 推荐(0)

rsa
摘要:/** * RSA公钥加密 * * @param str * 加密字符串 * @param publicKey * 公钥 * @return 密文 * @throws Exception * 加密过程中的异常信息 */public static String encrypt( String str, 阅读全文

posted @ 2019-09-05 09:01 Captain林 阅读(225) 评论(0) 推荐(0)

java aop 日志打印 正则设置
摘要:package tz.lion.Utils.aop;import com.alibaba.fastjson.JSON;import org.springframework.web.multipart.MultipartFile;import tz.lion.config.shiro.SessionH 阅读全文

posted @ 2019-04-30 09:21 Captain林 阅读(523) 评论(0) 推荐(0)

spring jpa 创建时间和更新时间自动更新
摘要:@Entity @Table(name="RS_SIGNUPUSER") public class RsSignUpUser { @Id @GenericGenerator(name="UUIDGENERATE",strategy="uuid2") @GeneratedValue(generator 阅读全文

posted @ 2017-08-21 10:10 Captain林 阅读(7355) 评论(0) 推荐(0)

springboot 跳过单元测试
摘要:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> 阅读全文

posted @ 2017-07-27 10:57 Captain林 阅读(2844) 评论(0) 推荐(0)

spring-boot 外部jar 打包 配置
摘要:<plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <compilerArguments> < 阅读全文

posted @ 2017-07-10 10:39 Captain林 阅读(472) 评论(0) 推荐(0)

java 修改文件
摘要:public void fileAlter(String fileName,String content) throws IOException{ BufferedReader reader = new BufferedReader(new FileReader(fileName)); String 阅读全文

posted @ 2016-11-22 16:18 Captain林 阅读(121) 评论(0) 推荐(0)

maven 加入json-lib.jar 报错 Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile
摘要:pom.xml 内容: [html] view plaincopy <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> </dependenc 阅读全文

posted @ 2015-02-12 21:40 Captain林 阅读(252) 评论(0) 推荐(0)

Java中读取某个目录下的所有文件和文件夹
摘要:Java中读取某个目录下的所有文件和文件夹 javafilestringpathimportclass import java.io.File;public class Test1 { public static void main(String[] args) { String path="d:/ 阅读全文

posted @ 2014-03-09 15:11 Captain林 阅读(471) 评论(0) 推荐(0)

导航