annotate src/goodjava/io/IoUtils.java @ 1731:842a0e0fd8c5

fix repeat stmt
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 02 Sep 2022 10:22:31 -0600
parents 2dbcc8360a3e
children 745f756e719b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1473
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 package goodjava.io;
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 import java.io.File;
1493
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
4 import java.io.InputStream;
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
5 import java.io.OutputStream;
1509
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
6 import java.io.Reader;
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
7 import java.io.InputStreamReader;
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
8 import java.io.Writer;
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
9 import java.io.StringWriter;
1473
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 import java.io.IOException;
1698
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
11 import java.net.InetAddress;
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
12 import java.net.Inet4Address;
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
13 import java.net.NetworkInterface;
1473
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 import java.nio.file.Files;
1548
736ec76bbf42 lucene log work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1547
diff changeset
15 import java.nio.file.attribute.FileTime;
1506
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
16 import java.security.Security;
1698
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
17 import java.util.Set;
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
18 import java.util.HashSet;
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
19 import java.util.Enumeration;
1506
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
20 import javax.net.ssl.SSLSocketFactory;
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
21 import javax.net.ssl.SSLServerSocketFactory;
1509
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
22 import goodjava.logging.Logger;
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
23 import goodjava.logging.LoggerFactory;
1473
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 public final class IoUtils {
1509
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
27 private static final Logger logger = LoggerFactory.getLogger(IoUtils.class);
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
28
1473
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 private IoUtils() {} // never
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 public static void move( File from, File to ) throws IOException {
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 Files.move( from.toPath(), to.toPath() );
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 }
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34
1661
08177ced7fa0 add file.copy_to
Franklin Schmidt <fschmidt@gmail.com>
parents: 1548
diff changeset
35 public static void copy( File from, File to ) throws IOException {
08177ced7fa0 add file.copy_to
Franklin Schmidt <fschmidt@gmail.com>
parents: 1548
diff changeset
36 Files.copy( from.toPath(), to.toPath() );
08177ced7fa0 add file.copy_to
Franklin Schmidt <fschmidt@gmail.com>
parents: 1548
diff changeset
37 }
08177ced7fa0 add file.copy_to
Franklin Schmidt <fschmidt@gmail.com>
parents: 1548
diff changeset
38
1473
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 public static void delete(File file) throws IOException {
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
40 Files.deleteIfExists( file.toPath() );
6c6ce14db6a8 add goodjava.io
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
41 }
1475
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
42
1501
Franklin Schmidt <fschmidt@gmail.com>
parents: 1499
diff changeset
43 public static void mkdirs(File file) throws IOException {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1499
diff changeset
44 Files.createDirectories( file.toPath() );
Franklin Schmidt <fschmidt@gmail.com>
parents: 1499
diff changeset
45 }
Franklin Schmidt <fschmidt@gmail.com>
parents: 1499
diff changeset
46
1475
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
47 public static boolean isSymbolicLink(File file) {
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
48 return Files.isSymbolicLink(file.toPath());
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
49 }
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
50
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
51 public static void deleteRecursively(File file) throws IOException {
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
52 if( file.isDirectory() && !isSymbolicLink(file) ) {
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
53 for( File f : file.listFiles() ) {
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
54 deleteRecursively(f);
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
55 }
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
56 }
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
57 delete(file);
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
58 }
c7b86342857f more IoUtils
Franklin Schmidt <fschmidt@gmail.com>
parents: 1473
diff changeset
59
1497
f04bfbb08721 link_from
Franklin Schmidt <fschmidt@gmail.com>
parents: 1494
diff changeset
60 public static void link(File existing,File link) throws IOException {
f04bfbb08721 link_from
Franklin Schmidt <fschmidt@gmail.com>
parents: 1494
diff changeset
61 Files.createLink( link.toPath(), existing.toPath() );
f04bfbb08721 link_from
Franklin Schmidt <fschmidt@gmail.com>
parents: 1494
diff changeset
62 }
f04bfbb08721 link_from
Franklin Schmidt <fschmidt@gmail.com>
parents: 1494
diff changeset
63
f04bfbb08721 link_from
Franklin Schmidt <fschmidt@gmail.com>
parents: 1494
diff changeset
64 public static void symlink(File existing,File link) throws IOException {
f04bfbb08721 link_from
Franklin Schmidt <fschmidt@gmail.com>
parents: 1494
diff changeset
65 Files.createSymbolicLink( link.toPath(), existing.toPath() );
1488
af55cfad6e12 start lucene.backup
Franklin Schmidt <fschmidt@gmail.com>
parents: 1475
diff changeset
66 }
af55cfad6e12 start lucene.backup
Franklin Schmidt <fschmidt@gmail.com>
parents: 1475
diff changeset
67
1548
736ec76bbf42 lucene log work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1547
diff changeset
68 public static long getCreationTime(File f) throws IOException {
736ec76bbf42 lucene log work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1547
diff changeset
69 return ((FileTime)Files.getAttribute(f.toPath(),"creationTime")).toMillis();
736ec76bbf42 lucene log work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1547
diff changeset
70 }
736ec76bbf42 lucene log work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1547
diff changeset
71
1494
91c167099462 more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1493
diff changeset
72 public static void copyAll(InputStream in,OutputStream out)
1493
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
73 throws IOException
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
74 {
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
75 byte[] a = new byte[8192];
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
76 int n;
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
77 while( (n=in.read(a)) != -1 ) {
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
78 out.write(a,0,n);
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
79 }
1499
22e15cf73040 lucene.backup
Franklin Schmidt <fschmidt@gmail.com>
parents: 1497
diff changeset
80 in.close();
1493
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
81 }
471ef3e6a84e more io
Franklin Schmidt <fschmidt@gmail.com>
parents: 1488
diff changeset
82
1509
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
83 public static void copyAll(Reader in,Writer out)
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
84 throws IOException
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
85 {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
86 char[] a = new char[8192];
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
87 int n;
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
88 while( (n=in.read(a)) != -1 ) {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
89 out.write(a,0,n);
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
90 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
91 in.close();
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
92 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
93
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
94 public static String readAll(Reader in)
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
95 throws IOException
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
96 {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
97 StringWriter sw = new StringWriter();
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
98 copyAll(in,sw);
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
99 return sw.toString();
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
100 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
101
1508
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
102 public static long checksum(InputStream in) throws IOException {
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
103 long cs = 0;
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
104 int c;
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
105 while( (c=in.read()) != -1 ) {
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
106 cs = 31 * cs + c;
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
107 }
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
108 in.close();
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
109 return cs;
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
110 }
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
111
1698
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
112 public static Set<InetAddress> getInetAddresses() throws IOException {
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
113 Set<InetAddress> set = new HashSet<InetAddress>();
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
114 for( Enumeration<NetworkInterface> e1 = NetworkInterface.getNetworkInterfaces(); e1.hasMoreElements(); ) {
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
115 NetworkInterface ni = e1.nextElement();
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
116 for( Enumeration<InetAddress> e2 = ni.getInetAddresses(); e2.hasMoreElements(); ) {
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
117 InetAddress ia = e2.nextElement();
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
118 set.add(ia);
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
119 }
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
120 }
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
121 return set;
2dbcc8360a3e backup security
Franklin Schmidt <fschmidt@gmail.com>
parents: 1661
diff changeset
122 }
1506
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
123
1509
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
124
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
125 public static class ProcException extends IOException {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
126 private ProcException(String msg) {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
127 super(msg);
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
128 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
129 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
130
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
131 public static void waitFor(Process proc)
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
132 throws IOException, ProcException
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
133 {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
134 try {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
135 proc.waitFor();
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
136 } catch(InterruptedException e) {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
137 throw new RuntimeException(e);
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
138 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
139 int exitVal = proc.exitValue();
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
140 if( exitVal != 0 ) {
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
141 StringWriter sw = new StringWriter();
1547
Franklin Schmidt <fschmidt@gmail.com>
parents: 1509
diff changeset
142 try {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1509
diff changeset
143 copyAll( new InputStreamReader(proc.getInputStream()), sw );
Franklin Schmidt <fschmidt@gmail.com>
parents: 1509
diff changeset
144 } catch(IOException e) {}
1509
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
145 copyAll( new InputStreamReader(proc.getErrorStream()), sw );
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
146 String error = sw.toString();
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
147 throw new ProcException(error);
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
148 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
149 }
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
150
0ba144491a42 lucene.backup zip
Franklin Schmidt <fschmidt@gmail.com>
parents: 1508
diff changeset
151
1506
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
152 static {
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
153 // undo restrictions of modern scum
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
154 Security.setProperty("jdk.tls.disabledAlgorithms","SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC");
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
155 }
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
156
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
157 public static SSLSocketFactory getSSLSocketFactory() {
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
158 return (SSLSocketFactory)SSLSocketFactory.getDefault();
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
159 }
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
160
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
161 public static SSLServerSocketFactory getSSLServerSocketFactory() {
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
162 return (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
163 }
d80395468b4e ssl security in code
Franklin Schmidt <fschmidt@gmail.com>
parents: 1501
diff changeset
164
1508
86c5e7000ecf lucene.backup checksum
Franklin Schmidt <fschmidt@gmail.com>
parents: 1506
diff changeset
165 }