equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
28 |
28 |
29 import java.io.FilePermission; |
29 import java.io.FilePermission; |
30 import java.nio.file.Files; |
30 import java.nio.file.Files; |
31 import java.nio.file.InvalidPathException; |
31 import java.nio.file.InvalidPathException; |
32 import java.nio.file.Path; |
32 import java.nio.file.Path; |
33 import java.nio.file.Paths; |
|
34 import java.security.AccessController; |
33 import java.security.AccessController; |
35 import java.security.PrivilegedAction; |
34 import java.security.PrivilegedAction; |
36 import java.util.Objects; |
35 import java.util.Objects; |
37 import java.util.concurrent.atomic.AtomicBoolean; |
36 import java.util.concurrent.atomic.AtomicBoolean; |
38 |
37 |
61 if (null == path) { |
60 if (null == path) { |
62 return null; |
61 return null; |
63 } |
62 } |
64 try { |
63 try { |
65 path = path.trim(); |
64 path = path.trim(); |
66 final Path dir = Paths.get(path.length() == 0 ? "." : path); |
65 final Path dir = Path.of(path.length() == 0 ? "." : path); |
67 AccessController.doPrivileged(new PrivilegedAction<>() { |
66 AccessController.doPrivileged(new PrivilegedAction<>() { |
68 @Override |
67 @Override |
69 public Void run() { |
68 public Void run() { |
70 validateDumpDir(dir); |
69 validateDumpDir(dir); |
71 return null; |
70 return null; |