comparison src/goodjava/io/IoUtils.java @ 1548:736ec76bbf42

lucene log work
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 27 Sep 2020 22:07:18 -0600
parents f24a9ba7551e
children 08177ced7fa0
comparison
equal deleted inserted replaced
1547:f24a9ba7551e 1548:736ec76bbf42
7 import java.io.InputStreamReader; 7 import java.io.InputStreamReader;
8 import java.io.Writer; 8 import java.io.Writer;
9 import java.io.StringWriter; 9 import java.io.StringWriter;
10 import java.io.IOException; 10 import java.io.IOException;
11 import java.nio.file.Files; 11 import java.nio.file.Files;
12 import java.nio.file.attribute.FileTime;
12 import java.security.Security; 13 import java.security.Security;
13 import javax.net.ssl.SSLSocketFactory; 14 import javax.net.ssl.SSLSocketFactory;
14 import javax.net.ssl.SSLServerSocketFactory; 15 import javax.net.ssl.SSLServerSocketFactory;
15 import goodjava.logging.Logger; 16 import goodjava.logging.Logger;
16 import goodjava.logging.LoggerFactory; 17 import goodjava.logging.LoggerFactory;
50 Files.createLink( link.toPath(), existing.toPath() ); 51 Files.createLink( link.toPath(), existing.toPath() );
51 } 52 }
52 53
53 public static void symlink(File existing,File link) throws IOException { 54 public static void symlink(File existing,File link) throws IOException {
54 Files.createSymbolicLink( link.toPath(), existing.toPath() ); 55 Files.createSymbolicLink( link.toPath(), existing.toPath() );
56 }
57
58 public static long getCreationTime(File f) throws IOException {
59 return ((FileTime)Files.getAttribute(f.toPath(),"creationTime")).toMillis();
55 } 60 }
56 61
57 public static void copyAll(InputStream in,OutputStream out) 62 public static void copyAll(InputStream in,OutputStream out)
58 throws IOException 63 throws IOException
59 { 64 {