mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8194746: (fs) Add equivalents of Paths.get to Path interface
Copy Paths.get() methods to Path.get() methods and have former call latter Reviewed-by: alanb, forax, chegar, psandoz
This commit is contained in:
parent
37f1b2b1e3
commit
9e3d8fd230
18 changed files with 174 additions and 119 deletions
|
@ -30,7 +30,7 @@ import java.lang.reflect.*;
|
|||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.security.*;
|
||||
import java.security.cert.Certificate;
|
||||
|
@ -278,7 +278,7 @@ public class PolicyFile extends java.security.Policy {
|
|||
public URL run() {
|
||||
String sep = File.separator;
|
||||
try {
|
||||
return Paths.get(System.getProperty("java.home"),
|
||||
return Path.of(System.getProperty("java.home"),
|
||||
"lib", "security",
|
||||
"default.policy").toUri().toURL();
|
||||
} catch (MalformedURLException mue) {
|
||||
|
|
|
@ -27,7 +27,7 @@ package sun.security.tools.keytool;
|
|||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.Path;
|
||||
import java.security.CodeSigner;
|
||||
import java.security.CryptoPrimitive;
|
||||
import java.security.KeyStore;
|
||||
|
@ -2189,7 +2189,7 @@ public final class Main {
|
|||
inplaceBackupName = srcksfname + ".old" + (n == 1 ? "" : n);
|
||||
File bkFile = new File(inplaceBackupName);
|
||||
if (!bkFile.exists()) {
|
||||
Files.copy(Paths.get(srcksfname), bkFile.toPath());
|
||||
Files.copy(Path.of(srcksfname), bkFile.toPath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue