forked from kekingcn/kkFileView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.新增压缩包内文件名称排序
- Loading branch information
Showing
22 changed files
with
2,280 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
jodconverter-web/src/main/java/cn/keking/FilePreviewApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package cn.keking; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import java.util.Properties; | ||
|
||
@SpringBootApplication | ||
@EnableScheduling | ||
@ComponentScan(value = "cn.keking.*") | ||
public class FilePreviewApplication { | ||
public static void main(String[] args) { | ||
Properties properties = System.getProperties(); | ||
System.out.println(properties.get("user.dir")); | ||
SpringApplication.run(FilePreviewApplication.class, args); | ||
} | ||
} |
242 changes: 242 additions & 0 deletions
242
jodconverter-web/src/main/java/cn/keking/config/RedissonConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
package cn.keking.config; | ||
|
||
import io.netty.channel.nio.NioEventLoopGroup; | ||
import org.redisson.Redisson; | ||
import org.redisson.api.RedissonClient; | ||
import org.redisson.client.codec.Codec; | ||
import org.redisson.config.Config; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.util.ClassUtils; | ||
|
||
/** | ||
* Created by kl on 2017/09/26. | ||
* redisson 客户端配置 | ||
*/ | ||
@ConfigurationProperties(prefix = "spring.redisson") | ||
@Configuration | ||
public class RedissonConfig { | ||
|
||
private String address; | ||
private int connectionMinimumIdleSize = 10; | ||
private int idleConnectionTimeout=10000; | ||
private int pingTimeout=1000; | ||
private int connectTimeout=10000; | ||
private int timeout=3000; | ||
private int retryAttempts=3; | ||
private int retryInterval=1500; | ||
private int reconnectionTimeout=3000; | ||
private int failedAttempts=3; | ||
private String password = null; | ||
private int subscriptionsPerConnection=5; | ||
private String clientName=null; | ||
private int subscriptionConnectionMinimumIdleSize = 1; | ||
private int subscriptionConnectionPoolSize = 50; | ||
private int connectionPoolSize = 64; | ||
private int database = 0; | ||
private boolean dnsMonitoring = false; | ||
private int dnsMonitoringInterval = 5000; | ||
|
||
private int thread; //当前处理核数量 * 2 | ||
|
||
private String codec="org.redisson.codec.JsonJacksonCodec"; | ||
|
||
@Bean(destroyMethod = "shutdown") | ||
RedissonClient redisson() throws Exception { | ||
Config config = new Config(); | ||
config.useSingleServer().setAddress(address) | ||
.setConnectionMinimumIdleSize(connectionMinimumIdleSize) | ||
.setConnectionPoolSize(connectionPoolSize) | ||
.setDatabase(database) | ||
.setDnsMonitoring(dnsMonitoring) | ||
.setDnsMonitoringInterval(dnsMonitoringInterval) | ||
.setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) | ||
.setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) | ||
.setSubscriptionsPerConnection(subscriptionsPerConnection) | ||
.setClientName(clientName) | ||
.setFailedAttempts(failedAttempts) | ||
.setRetryAttempts(retryAttempts) | ||
.setRetryInterval(retryInterval) | ||
.setReconnectionTimeout(reconnectionTimeout) | ||
.setTimeout(timeout) | ||
.setConnectTimeout(connectTimeout) | ||
.setIdleConnectionTimeout(idleConnectionTimeout) | ||
.setPingTimeout(pingTimeout) | ||
.setPassword(password); | ||
Codec codec=(Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); | ||
config.setCodec(codec); | ||
config.setThreads(thread); | ||
config.setEventLoopGroup(new NioEventLoopGroup()); | ||
config.setUseLinuxNativeEpoll(false); | ||
return Redisson.create(config); | ||
} | ||
|
||
public int getThread() { | ||
return thread; | ||
} | ||
|
||
public void setThread(int thread) { | ||
this.thread = thread; | ||
} | ||
|
||
public String getAddress() { | ||
return address; | ||
} | ||
|
||
public void setAddress(String address) { | ||
this.address = address; | ||
} | ||
|
||
public int getIdleConnectionTimeout() { | ||
return idleConnectionTimeout; | ||
} | ||
|
||
public void setIdleConnectionTimeout(int idleConnectionTimeout) { | ||
this.idleConnectionTimeout = idleConnectionTimeout; | ||
} | ||
|
||
public int getPingTimeout() { | ||
return pingTimeout; | ||
} | ||
|
||
public void setPingTimeout(int pingTimeout) { | ||
this.pingTimeout = pingTimeout; | ||
} | ||
|
||
public int getConnectTimeout() { | ||
return connectTimeout; | ||
} | ||
|
||
public void setConnectTimeout(int connectTimeout) { | ||
this.connectTimeout = connectTimeout; | ||
} | ||
|
||
public int getTimeout() { | ||
return timeout; | ||
} | ||
|
||
public void setTimeout(int timeout) { | ||
this.timeout = timeout; | ||
} | ||
|
||
public int getRetryAttempts() { | ||
return retryAttempts; | ||
} | ||
|
||
public void setRetryAttempts(int retryAttempts) { | ||
this.retryAttempts = retryAttempts; | ||
} | ||
|
||
public int getRetryInterval() { | ||
return retryInterval; | ||
} | ||
|
||
public void setRetryInterval(int retryInterval) { | ||
this.retryInterval = retryInterval; | ||
} | ||
|
||
public int getReconnectionTimeout() { | ||
return reconnectionTimeout; | ||
} | ||
|
||
public void setReconnectionTimeout(int reconnectionTimeout) { | ||
this.reconnectionTimeout = reconnectionTimeout; | ||
} | ||
|
||
public int getFailedAttempts() { | ||
return failedAttempts; | ||
} | ||
|
||
public void setFailedAttempts(int failedAttempts) { | ||
this.failedAttempts = failedAttempts; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public int getSubscriptionsPerConnection() { | ||
return subscriptionsPerConnection; | ||
} | ||
|
||
public void setSubscriptionsPerConnection(int subscriptionsPerConnection) { | ||
this.subscriptionsPerConnection = subscriptionsPerConnection; | ||
} | ||
|
||
public String getClientName() { | ||
return clientName; | ||
} | ||
|
||
public void setClientName(String clientName) { | ||
this.clientName = clientName; | ||
} | ||
|
||
public int getSubscriptionConnectionMinimumIdleSize() { | ||
return subscriptionConnectionMinimumIdleSize; | ||
} | ||
|
||
public void setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize) { | ||
this.subscriptionConnectionMinimumIdleSize = subscriptionConnectionMinimumIdleSize; | ||
} | ||
|
||
public int getSubscriptionConnectionPoolSize() { | ||
return subscriptionConnectionPoolSize; | ||
} | ||
|
||
public void setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize) { | ||
this.subscriptionConnectionPoolSize = subscriptionConnectionPoolSize; | ||
} | ||
|
||
public int getConnectionMinimumIdleSize() { | ||
return connectionMinimumIdleSize; | ||
} | ||
|
||
public void setConnectionMinimumIdleSize(int connectionMinimumIdleSize) { | ||
this.connectionMinimumIdleSize = connectionMinimumIdleSize; | ||
} | ||
|
||
public int getConnectionPoolSize() { | ||
return connectionPoolSize; | ||
} | ||
|
||
public void setConnectionPoolSize(int connectionPoolSize) { | ||
this.connectionPoolSize = connectionPoolSize; | ||
} | ||
|
||
public int getDatabase() { | ||
return database; | ||
} | ||
|
||
public void setDatabase(int database) { | ||
this.database = database; | ||
} | ||
|
||
public boolean isDnsMonitoring() { | ||
return dnsMonitoring; | ||
} | ||
|
||
public void setDnsMonitoring(boolean dnsMonitoring) { | ||
this.dnsMonitoring = dnsMonitoring; | ||
} | ||
|
||
public int getDnsMonitoringInterval() { | ||
return dnsMonitoringInterval; | ||
} | ||
|
||
public void setDnsMonitoringInterval(int dnsMonitoringInterval) { | ||
this.dnsMonitoringInterval = dnsMonitoringInterval; | ||
} | ||
|
||
public String getCodec() { | ||
return codec; | ||
} | ||
|
||
public void setCodec(String codec) { | ||
this.codec = codec; | ||
} | ||
} |
Oops, something went wrong.