Mercurial Hosting > luan
comparison src/goodjava/lucene/backup/BackupServer.java @ 1501:e66e3d50b289
mkdirs
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 10 May 2020 22:28:13 -0600 |
parents | 22e15cf73040 |
children | 8a7b6b32c691 |
comparison
equal
deleted
inserted
replaced
1500:f01abd6d5858 | 1501:e66e3d50b289 |
---|---|
8 import java.util.concurrent.ThreadPoolExecutor; | 8 import java.util.concurrent.ThreadPoolExecutor; |
9 import java.util.concurrent.Executors; | 9 import java.util.concurrent.Executors; |
10 import javax.net.ssl.SSLServerSocketFactory; | 10 import javax.net.ssl.SSLServerSocketFactory; |
11 import javax.net.ssl.SSLServerSocket; | 11 import javax.net.ssl.SSLServerSocket; |
12 import goodjava.util.SoftCacheMap; | 12 import goodjava.util.SoftCacheMap; |
13 import goodjava.io.IoUtils; | |
13 import goodjava.rpc.RpcServer; | 14 import goodjava.rpc.RpcServer; |
14 import goodjava.rpc.RpcCall; | 15 import goodjava.rpc.RpcCall; |
15 import goodjava.logging.Logger; | 16 import goodjava.logging.Logger; |
16 import goodjava.logging.LoggerFactory; | 17 import goodjava.logging.LoggerFactory; |
17 | 18 |
39 | 40 |
40 private final File backupDir; | 41 private final File backupDir; |
41 private static final ThreadPoolExecutor threadPool = (ThreadPoolExecutor)Executors.newCachedThreadPool(); | 42 private static final ThreadPoolExecutor threadPool = (ThreadPoolExecutor)Executors.newCachedThreadPool(); |
42 private static final Map<String,Backup> backups = new SoftCacheMap<String,Backup>(); | 43 private static final Map<String,Backup> backups = new SoftCacheMap<String,Backup>(); |
43 | 44 |
44 public BackupServer(File backupDir) { | 45 public BackupServer(File backupDir) throws IOException { |
45 this.backupDir = backupDir; | 46 this.backupDir = backupDir; |
46 backupDir.mkdirs(); | 47 IoUtils.mkdirs(backupDir); |
47 } | 48 } |
48 | 49 |
49 public synchronized void start() throws IOException { | 50 public synchronized void start() throws IOException { |
50 final ServerSocket ss; | 51 final ServerSocket ss; |
51 if( cipherSuites == null ) { | 52 if( cipherSuites == null ) { |