Maven profile in IntellJ IDEA
IntelliJ IDEA lets you use Maven build profiles which can help you customize builds for a particular environment, for example, production or development.
sftp and ftp in java
FTP是一种文件传输协议,一般是为了方便数据共享的。包括一个FTP服务器和多个FTP客户端。FTP客户端通过FTP协议在服务器上下载资源。而SFTP协议是在FTP的基础上对数据进行加密,使得传输的数据相对来说更安全。但是这种安全是以牺牲效率为代价的,也就是说SFTP的传输效率比FTP要低(不过现实使用当中,没有发现多大差别)。个人肤浅的认为就是:一;FTP要安装,SFTP不要安装。二;SFTP更安全,但更安全带来副作用就是的效率比FTP要低些。
Springboot获取服务端口
Springboot项目再启动的过程中依次发布的事件为:1
2
3
4class org.springframework.context.event.ContextRefreshedEvent
class org.springframework.boot.web.servlet.context.**ServletWebServerInitializedEvent**
class org.springframework.boot.context.event.ApplicationStartedEvent
class org.springframework.boot.context.event.ApplicationReadyEvent
1 | @Component |
JAVA call Shell Script
在JAVA中调用`Shell`,源于小米开源SQL优化工具[SOAR](https://github.com/XiaoMi/soar),具体工具使用方法可以直接在[GitHub](https://github.com/XiaoMi/soar)上查看。但是该工具没有界面,于是想通过前端界面发送sql到后台,由后台调用shell脚本来执行。
Redis连接池
1 | package com.alwyn.redis.test; |
测试1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20package com.alwyn.redis.test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
public class JedisPoolDemo {
public static void main(String[] args) {
JedisPool jedisPool = RedisPoolUtils.getInstance();
Jedis jedis = null;
try
{
jedis = jedisPool.getResource();
jedis.set("k18","v183");
} catch (Exception e) {
e.printStackTrace();
}finally{
RedisPoolUtils.release(jedisPool, jedis);
}
}
}
Spring注解开发实现零配置
Spring是一个管理Bean的容器,由于Bean与Bean之间的依赖关系而引入了DI从而实现一种IOC,即控制反转,因此Spring容器也可以被称作IOC容器(ApplicationContext)。