随笔分类 - java
摘要:在tomcat的bin/startup.sh中添加: 27780debug的端口 declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server
阅读全文
摘要:解析psot请求中的JSON参数 代码: Map<String, String> attrMap = new HashMap<String, String>(); BufferedReader streamReader = null; try { streamReader = new Buffere
阅读全文
摘要:工具类 package com.cog.utils; import java.lang.reflect.Field; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 转换工具类 * @autho
阅读全文
摘要:import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.util.LinkedList;impor
阅读全文
摘要:查看当前分支记录用于查看分支基于哪个分支创建,必须在本地创建的分支才可以看到 git reflog --date=local --all | grep <branchname>
阅读全文
摘要:/** * @description :类字节码文件扫描工具,可以扫描jar包 */ public class Utils { //从包路径下扫描 public static Set<Class> getClasses(String packagePath) { Set<Class> res = n
阅读全文
摘要:/** * @description :类字节码文件扫描工具,不可扫描jar包 */ public class ClassScanner { /** * 获得包下面的所有的class * * @param * @return List包含所有class的实例 */ public static Lis
阅读全文
摘要:样例 目录 1 基本样例 1.1 加入依赖: 1.2 消息发送 1、Producer端发送同步消息 2、发送异步消息 3、单向发送消息 1.3 消费消息 2 顺序消息样例 2.1 顺序消息生产 2.2 顺序消费消息 3 延时消息样例 3.1 启动消费者等待传入订阅消息 3.2 发送延时消息 3.3
阅读全文
摘要:import javax.mail.*; import javax.mail.internet.*; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; public class
阅读全文
摘要:1.pom <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.3</version> </depende
阅读全文
摘要:1 import org.springframework.core.annotation.Order; 2 import org.springframework.stereotype.Component; 3 import org.springframework.web.filter.OncePer
阅读全文
摘要:1.较大分组的位置(相同字符串的下标集合长度>=3) public static List<List<Integer>> largeGroupPositions(String s){ List<List<Integer>> res = new ArrayList<>(); //相同字符串左边边界 i
阅读全文
摘要:1.整数反转 /** * 整数反转 * @param x * @return */ public static int reverse(int x) { long res = 0; while (x != 0) { res = res * 10 + x % 10; x /= 10; } return
阅读全文
摘要:1.indexOf() /** * Returns the index within this string of the first occurrence of the * specified substring. * * <p>The returned index is the smallest
阅读全文
摘要:1.获取当前月第一天 /** * 获取当前月的第一天 * * @return */ public static Date getFirstDayOfMonth() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.
阅读全文
摘要:1.启动类 @SpringBootApplication public class serverApplication { public static void main(String[] args) { SpringApplication.run(serverApplication.class,
阅读全文
摘要:1.pom 1 <dependency> 2 <groupId>net.oschina.zcx7878</groupId> 3 <artifactId>fastdfs-client-java</artifactId> 4 <version>1.27.0.0</version> 5 </depende
阅读全文
摘要:Apache POI 简介是用Java编写的免费开源的跨平台的 Java API,Apache POI提供API给Java程式对Microsoft Office(Excel、WORD、PowerPoint、Visio等)格式档案读和写的功能。POI为“Poor Obfuscation Impleme
阅读全文
摘要:1.java递归删除某一文件夹下的文件 1 /** 2 * 递归删除文件 3 * @param file 4 */ 5 public static void delAll(File file) { 6 //获取包含file对象对应的子目录或者文件 7 File[] b = file.listFile
阅读全文
摘要:遇到JSON串有反斜杠就把它转成对象输出,具体什么对象自己分析一下,以下为示例: String genData = mockDataService.creatFile(dataMap); Map respMap = JSON.parseObject(genData, new TypeReferenc
阅读全文

浙公网安备 33010602011771号