author | ohair |
Wed, 06 Apr 2011 22:06:11 -0700 | |
changeset 9035 | 1255eb81cc2f |
parent 8158 | 77d9c0f1c19f |
child 9050 | 26c2c1de1631 |
permissions | -rw-r--r-- |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
1 |
/* |
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
8158
diff
changeset
|
2 |
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
4 |
* |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
10 |
* |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
15 |
* accompanied this code). |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
16 |
* |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
20 |
* |
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
24 |
*/ |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
25 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
26 |
package sun.nio.fs; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
27 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
28 |
import java.nio.file.*; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
29 |
import java.nio.file.attribute.*; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
30 |
import java.nio.channels.*; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
31 |
import java.net.URI; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
32 |
import java.util.concurrent.ExecutorService; |
8158 | 33 |
import java.io.*; |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
34 |
import java.util.*; |
8158 | 35 |
import java.security.AccessController; |
36 |
import sun.misc.Unsafe; |
|
37 |
import sun.nio.ch.ThreadPool; |
|
38 |
import sun.security.util.SecurityConstants; |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
39 |
|
8158 | 40 |
import static sun.nio.fs.WindowsNativeDispatcher.*; |
41 |
import static sun.nio.fs.WindowsConstants.*; |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
42 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
43 |
public class WindowsFileSystemProvider |
8158 | 44 |
extends AbstractFileSystemProvider |
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
45 |
{ |
8158 | 46 |
private static final Unsafe unsafe = Unsafe.getUnsafe(); |
47 |
||
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
48 |
private static final String USER_DIR = "user.dir"; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
49 |
private final WindowsFileSystem theFileSystem; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
50 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
51 |
public WindowsFileSystemProvider() { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
52 |
theFileSystem = new WindowsFileSystem(this, System.getProperty(USER_DIR)); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
53 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
54 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
55 |
@Override |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
56 |
public String getScheme() { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
57 |
return "file"; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
58 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
59 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
60 |
private void checkUri(URI uri) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
61 |
if (!uri.getScheme().equalsIgnoreCase(getScheme())) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
62 |
throw new IllegalArgumentException("URI does not match this provider"); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
63 |
if (uri.getAuthority() != null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
64 |
throw new IllegalArgumentException("Authority component present"); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
65 |
if (uri.getPath() == null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
66 |
throw new IllegalArgumentException("Path component is undefined"); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
67 |
if (!uri.getPath().equals("/")) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
68 |
throw new IllegalArgumentException("Path component should be '/'"); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
69 |
if (uri.getQuery() != null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
70 |
throw new IllegalArgumentException("Query component present"); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
71 |
if (uri.getFragment() != null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
72 |
throw new IllegalArgumentException("Fragment component present"); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
73 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
74 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
75 |
@Override |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
76 |
public FileSystem newFileSystem(URI uri, Map<String,?> env) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
77 |
throws IOException |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
78 |
{ |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
79 |
checkUri(uri); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
80 |
throw new FileSystemAlreadyExistsException(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
81 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
82 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
83 |
@Override |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
84 |
public final FileSystem getFileSystem(URI uri) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
85 |
checkUri(uri); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
86 |
return theFileSystem; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
87 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
88 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
89 |
@Override |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
90 |
public Path getPath(URI uri) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
91 |
return WindowsUriSupport.fromUri(theFileSystem, uri); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
92 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
93 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
94 |
@Override |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
95 |
public FileChannel newFileChannel(Path path, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
96 |
Set<? extends OpenOption> options, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
97 |
FileAttribute<?>... attrs) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
98 |
throws IOException |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
99 |
{ |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
100 |
if (path == null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
101 |
throw new NullPointerException(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
102 |
if (!(path instanceof WindowsPath)) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
103 |
throw new ProviderMismatchException(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
104 |
WindowsPath file = (WindowsPath)path; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
105 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
106 |
WindowsSecurityDescriptor sd = WindowsSecurityDescriptor.fromAttribute(attrs); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
107 |
try { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
108 |
return WindowsChannelFactory |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
109 |
.newFileChannel(file.getPathForWin32Calls(), |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
110 |
file.getPathForPermissionCheck(), |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
111 |
options, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
112 |
sd.address()); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
113 |
} catch (WindowsException x) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
114 |
x.rethrowAsIOException(file); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
115 |
return null; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
116 |
} finally { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
117 |
if (sd != null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
118 |
sd.release(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
119 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
120 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
121 |
|
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
122 |
@Override |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
123 |
public AsynchronousFileChannel newAsynchronousFileChannel(Path path, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
124 |
Set<? extends OpenOption> options, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
125 |
ExecutorService executor, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
126 |
FileAttribute<?>... attrs) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
127 |
throws IOException |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
128 |
{ |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
129 |
if (path == null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
130 |
throw new NullPointerException(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
131 |
if (!(path instanceof WindowsPath)) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
132 |
throw new ProviderMismatchException(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
133 |
WindowsPath file = (WindowsPath)path; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
134 |
ThreadPool pool = (executor == null) ? null : ThreadPool.wrap(executor, 0); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
135 |
WindowsSecurityDescriptor sd = |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
136 |
WindowsSecurityDescriptor.fromAttribute(attrs); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
137 |
try { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
138 |
return WindowsChannelFactory |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
139 |
.newAsynchronousFileChannel(file.getPathForWin32Calls(), |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
140 |
file.getPathForPermissionCheck(), |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
141 |
options, |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
142 |
sd.address(), |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
143 |
pool); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
144 |
} catch (WindowsException x) { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
145 |
x.rethrowAsIOException(file); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
146 |
return null; |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
147 |
} finally { |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
148 |
if (sd != null) |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
149 |
sd.release(); |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
150 |
} |
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
151 |
} |
8158 | 152 |
|
153 |
private boolean followLinks(LinkOption... options) { |
|
154 |
boolean followLinks = true; |
|
155 |
for (LinkOption option: options) { |
|
156 |
if (option == LinkOption.NOFOLLOW_LINKS) { |
|
157 |
followLinks = false; |
|
158 |
continue; |
|
159 |
} |
|
160 |
if (option == null) |
|
161 |
throw new NullPointerException(); |
|
162 |
throw new AssertionError("Should not get here"); |
|
163 |
} |
|
164 |
return followLinks; |
|
165 |
} |
|
166 |
||
167 |
@Override |
|
168 |
@SuppressWarnings("unchecked") |
|
169 |
public <V extends FileAttributeView> V |
|
170 |
getFileAttributeView(Path obj, Class<V> view, LinkOption... options) |
|
171 |
{ |
|
172 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
173 |
if (view == null) |
|
174 |
throw new NullPointerException(); |
|
175 |
boolean followLinks = followLinks(options); |
|
176 |
if (view == BasicFileAttributeView.class) |
|
177 |
return (V) WindowsFileAttributeViews.createBasicView(file, followLinks); |
|
178 |
if (view == DosFileAttributeView.class) |
|
179 |
return (V) WindowsFileAttributeViews.createDosView(file, followLinks); |
|
180 |
if (view == AclFileAttributeView.class) |
|
181 |
return (V) new WindowsAclFileAttributeView(file, followLinks); |
|
182 |
if (view == FileOwnerAttributeView.class) |
|
183 |
return (V) new FileOwnerAttributeViewImpl( |
|
184 |
new WindowsAclFileAttributeView(file, followLinks)); |
|
185 |
if (view == UserDefinedFileAttributeView.class) |
|
186 |
return (V) new WindowsUserDefinedFileAttributeView(file, followLinks); |
|
187 |
return (V) null; |
|
188 |
} |
|
189 |
||
190 |
@Override |
|
191 |
@SuppressWarnings("unchecked") |
|
192 |
public <A extends BasicFileAttributes> A readAttributes(Path file, |
|
193 |
Class<A> type, |
|
194 |
LinkOption... options) |
|
195 |
throws IOException |
|
196 |
{ |
|
197 |
Class<? extends BasicFileAttributeView> view; |
|
198 |
if (type == BasicFileAttributes.class) |
|
199 |
view = BasicFileAttributeView.class; |
|
200 |
else if (type == DosFileAttributes.class) |
|
201 |
view = DosFileAttributeView.class; |
|
202 |
else if (type == null) |
|
203 |
throw new NullPointerException(); |
|
204 |
else |
|
205 |
throw new UnsupportedOperationException(); |
|
206 |
return (A) getFileAttributeView(file, view, options).readAttributes(); |
|
207 |
} |
|
208 |
||
209 |
@Override |
|
210 |
public DynamicFileAttributeView getFileAttributeView(Path obj, String name, LinkOption... options) { |
|
211 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
212 |
boolean followLinks = followLinks(options); |
|
213 |
if (name.equals("basic")) |
|
214 |
return WindowsFileAttributeViews.createBasicView(file, followLinks); |
|
215 |
if (name.equals("dos")) |
|
216 |
return WindowsFileAttributeViews.createDosView(file, followLinks); |
|
217 |
if (name.equals("acl")) |
|
218 |
return new WindowsAclFileAttributeView(file, followLinks); |
|
219 |
if (name.equals("owner")) |
|
220 |
return new FileOwnerAttributeViewImpl( |
|
221 |
new WindowsAclFileAttributeView(file, followLinks)); |
|
222 |
if (name.equals("user")) |
|
223 |
return new WindowsUserDefinedFileAttributeView(file, followLinks); |
|
224 |
return null; |
|
225 |
} |
|
226 |
||
227 |
@Override |
|
228 |
public SeekableByteChannel newByteChannel(Path obj, |
|
229 |
Set<? extends OpenOption> options, |
|
230 |
FileAttribute<?>... attrs) |
|
231 |
throws IOException |
|
232 |
{ |
|
233 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
234 |
WindowsSecurityDescriptor sd = |
|
235 |
WindowsSecurityDescriptor.fromAttribute(attrs); |
|
236 |
try { |
|
237 |
return WindowsChannelFactory |
|
238 |
.newFileChannel(file.getPathForWin32Calls(), |
|
239 |
file.getPathForPermissionCheck(), |
|
240 |
options, |
|
241 |
sd.address()); |
|
242 |
} catch (WindowsException x) { |
|
243 |
x.rethrowAsIOException(file); |
|
244 |
return null; // keep compiler happy |
|
245 |
} finally { |
|
246 |
sd.release(); |
|
247 |
} |
|
248 |
} |
|
249 |
||
250 |
@Override |
|
251 |
boolean implDelete(Path obj, boolean failIfNotExists) throws IOException { |
|
252 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
253 |
file.checkDelete(); |
|
254 |
||
255 |
WindowsFileAttributes attrs = null; |
|
256 |
try { |
|
257 |
// need to know if file is a directory or junction |
|
258 |
attrs = WindowsFileAttributes.get(file, false); |
|
259 |
if (attrs.isDirectory() || attrs.isDirectoryLink()) { |
|
260 |
RemoveDirectory(file.getPathForWin32Calls()); |
|
261 |
} else { |
|
262 |
DeleteFile(file.getPathForWin32Calls()); |
|
263 |
} |
|
264 |
return true; |
|
265 |
} catch (WindowsException x) { |
|
266 |
||
267 |
// no-op if file does not exist |
|
268 |
if (!failIfNotExists && |
|
269 |
(x.lastError() == ERROR_FILE_NOT_FOUND || |
|
270 |
x.lastError() == ERROR_PATH_NOT_FOUND)) return false; |
|
271 |
||
272 |
if (attrs != null && attrs.isDirectory()) { |
|
273 |
// ERROR_ALREADY_EXISTS is returned when attempting to delete |
|
274 |
// non-empty directory on SAMBA servers. |
|
275 |
if (x.lastError() == ERROR_DIR_NOT_EMPTY || |
|
276 |
x.lastError() == ERROR_ALREADY_EXISTS) |
|
277 |
{ |
|
278 |
throw new DirectoryNotEmptyException( |
|
279 |
file.getPathForExceptionMessage()); |
|
280 |
} |
|
281 |
} |
|
282 |
x.rethrowAsIOException(file); |
|
283 |
return false; |
|
284 |
} |
|
285 |
} |
|
286 |
||
287 |
@Override |
|
288 |
public void copy(Path source, Path target, CopyOption... options) |
|
289 |
throws IOException |
|
290 |
{ |
|
291 |
WindowsFileCopy.copy(WindowsPath.toWindowsPath(source), |
|
292 |
WindowsPath.toWindowsPath(target), |
|
293 |
options); |
|
294 |
} |
|
295 |
||
296 |
@Override |
|
297 |
public void move(Path source, Path target, CopyOption... options) |
|
298 |
throws IOException |
|
299 |
{ |
|
300 |
WindowsFileCopy.move(WindowsPath.toWindowsPath(source), |
|
301 |
WindowsPath.toWindowsPath(target), |
|
302 |
options); |
|
303 |
} |
|
304 |
||
305 |
/** |
|
306 |
* Returns buffer with SID_AND_ATTRIBUTES structure representing the user |
|
307 |
* associated with the current thread access token. |
|
308 |
* FIXME - this should be cached. |
|
309 |
*/ |
|
310 |
private static NativeBuffer getUserInfo(WindowsPath file) throws IOException { |
|
311 |
try { |
|
312 |
long hToken = WindowsSecurity.processTokenWithQueryAccess; |
|
313 |
int size = GetTokenInformation(hToken, TokenUser, 0L, 0); |
|
314 |
assert size > 0; |
|
315 |
||
316 |
NativeBuffer buffer = NativeBuffers.getNativeBuffer(size); |
|
317 |
try { |
|
318 |
int newsize = GetTokenInformation(hToken, TokenUser, |
|
319 |
buffer.address(), size); |
|
320 |
if (newsize != size) |
|
321 |
throw new AssertionError(); |
|
322 |
return buffer; |
|
323 |
} catch (WindowsException x) { |
|
324 |
buffer.release(); |
|
325 |
throw x; |
|
326 |
} |
|
327 |
} catch (WindowsException x) { |
|
328 |
throw new IOException(x.getMessage()); |
|
329 |
} |
|
330 |
} |
|
331 |
||
332 |
/** |
|
333 |
* Reads the file ACL and return the effective access as ACCESS_MASK |
|
334 |
*/ |
|
335 |
private static int getEffectiveAccess(WindowsPath file) throws IOException { |
|
336 |
// read security descriptor continaing ACL (symlinks are followed) |
|
337 |
String target = WindowsLinkSupport.getFinalPath(file, true); |
|
338 |
NativeBuffer aclBuffer = WindowsAclFileAttributeView |
|
339 |
.getFileSecurity(target, DACL_SECURITY_INFORMATION); |
|
340 |
||
341 |
// retrieves DACL from security descriptor |
|
342 |
long pAcl = GetSecurityDescriptorDacl(aclBuffer.address()); |
|
343 |
||
344 |
// Use GetEffectiveRightsFromAcl to get effective access to file |
|
345 |
try { |
|
346 |
NativeBuffer userBuffer = getUserInfo(file); |
|
347 |
try { |
|
348 |
try { |
|
349 |
// SID_AND_ATTRIBUTES->pSid |
|
350 |
long pSid = unsafe.getAddress(userBuffer.address()); |
|
351 |
long pTrustee = BuildTrusteeWithSid(pSid); |
|
352 |
try { |
|
353 |
return GetEffectiveRightsFromAcl(pAcl, pTrustee); |
|
354 |
} finally { |
|
355 |
LocalFree(pTrustee); |
|
356 |
} |
|
357 |
} catch (WindowsException x) { |
|
358 |
throw new IOException("Unable to get effective rights from ACL: " + |
|
359 |
x.getMessage()); |
|
360 |
} |
|
361 |
} finally { |
|
362 |
userBuffer.release(); |
|
363 |
} |
|
364 |
} finally { |
|
365 |
aclBuffer.release(); |
|
366 |
} |
|
367 |
} |
|
368 |
||
369 |
@Override |
|
370 |
public void checkAccess(Path obj, AccessMode... modes) throws IOException { |
|
371 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
372 |
// if no access modes then simply file attributes |
|
373 |
if (modes.length == 0) { |
|
374 |
file.checkRead(); |
|
375 |
try { |
|
376 |
WindowsFileAttributes.get(file, true); |
|
377 |
} catch (WindowsException exc) { |
|
378 |
exc.rethrowAsIOException(file); |
|
379 |
} |
|
380 |
return; |
|
381 |
} |
|
382 |
||
383 |
boolean r = false; |
|
384 |
boolean w = false; |
|
385 |
boolean x = false; |
|
386 |
for (AccessMode mode: modes) { |
|
387 |
switch (mode) { |
|
388 |
case READ : r = true; break; |
|
389 |
case WRITE : w = true; break; |
|
390 |
case EXECUTE : x = true; break; |
|
391 |
default: throw new AssertionError("Should not get here"); |
|
392 |
} |
|
393 |
} |
|
394 |
||
395 |
int mask = 0; |
|
396 |
if (r) { |
|
397 |
file.checkRead(); |
|
398 |
mask |= FILE_READ_DATA; |
|
399 |
} |
|
400 |
if (w) { |
|
401 |
file.checkWrite(); |
|
402 |
mask |= FILE_WRITE_DATA; |
|
403 |
} |
|
404 |
if (x) { |
|
405 |
SecurityManager sm = System.getSecurityManager(); |
|
406 |
if (sm != null) |
|
407 |
sm.checkExec(file.getPathForPermissionCheck()); |
|
408 |
mask |= FILE_EXECUTE; |
|
409 |
} |
|
410 |
||
411 |
if ((getEffectiveAccess(file) & mask) == 0) |
|
412 |
throw new AccessDeniedException( |
|
413 |
file.getPathForExceptionMessage(), null, |
|
414 |
"Effective permissions does not allow requested access"); |
|
415 |
||
416 |
// for write access we neeed to check if the DOS readonly attribute |
|
417 |
// and if the volume is read-only |
|
418 |
if (w) { |
|
419 |
try { |
|
420 |
WindowsFileAttributes attrs = WindowsFileAttributes.get(file, true); |
|
421 |
if (!attrs.isDirectory() && attrs.isReadOnly()) |
|
422 |
throw new AccessDeniedException( |
|
423 |
file.getPathForExceptionMessage(), null, |
|
424 |
"DOS readonly attribute is set"); |
|
425 |
} catch (WindowsException exc) { |
|
426 |
exc.rethrowAsIOException(file); |
|
427 |
} |
|
428 |
||
429 |
if (WindowsFileStore.create(file).isReadOnly()) { |
|
430 |
throw new AccessDeniedException( |
|
431 |
file.getPathForExceptionMessage(), null, "Read-only file system"); |
|
432 |
} |
|
433 |
return; |
|
434 |
} |
|
435 |
} |
|
436 |
||
437 |
@Override |
|
438 |
public boolean isSameFile(Path obj1, Path obj2) throws IOException { |
|
439 |
WindowsPath file1 = WindowsPath.toWindowsPath(obj1); |
|
440 |
if (file1.equals(obj2)) |
|
441 |
return true; |
|
442 |
if (obj2 == null) |
|
443 |
throw new NullPointerException(); |
|
444 |
if (!(obj2 instanceof WindowsPath)) |
|
445 |
return false; |
|
446 |
WindowsPath file2 = (WindowsPath)obj2; |
|
447 |
||
448 |
// check security manager access to both files |
|
449 |
file1.checkRead(); |
|
450 |
file2.checkRead(); |
|
451 |
||
452 |
// open both files and see if they are the same |
|
453 |
long h1 = 0L; |
|
454 |
try { |
|
455 |
h1 = file1.openForReadAttributeAccess(true); |
|
456 |
} catch (WindowsException x) { |
|
457 |
x.rethrowAsIOException(file1); |
|
458 |
} |
|
459 |
try { |
|
460 |
WindowsFileAttributes attrs1 = null; |
|
461 |
try { |
|
462 |
attrs1 = WindowsFileAttributes.readAttributes(h1); |
|
463 |
} catch (WindowsException x) { |
|
464 |
x.rethrowAsIOException(file1); |
|
465 |
} |
|
466 |
long h2 = 0L; |
|
467 |
try { |
|
468 |
h2 = file2.openForReadAttributeAccess(true); |
|
469 |
} catch (WindowsException x) { |
|
470 |
x.rethrowAsIOException(file2); |
|
471 |
} |
|
472 |
try { |
|
473 |
WindowsFileAttributes attrs2 = null; |
|
474 |
try { |
|
475 |
attrs2 = WindowsFileAttributes.readAttributes(h2); |
|
476 |
} catch (WindowsException x) { |
|
477 |
x.rethrowAsIOException(file2); |
|
478 |
} |
|
479 |
return WindowsFileAttributes.isSameFile(attrs1, attrs2); |
|
480 |
} finally { |
|
481 |
CloseHandle(h2); |
|
482 |
} |
|
483 |
} finally { |
|
484 |
CloseHandle(h1); |
|
485 |
} |
|
486 |
} |
|
487 |
||
488 |
@Override |
|
489 |
public boolean isHidden(Path obj) throws IOException { |
|
490 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
491 |
file.checkRead(); |
|
492 |
WindowsFileAttributes attrs = null; |
|
493 |
try { |
|
494 |
attrs = WindowsFileAttributes.get(file, true); |
|
495 |
} catch (WindowsException x) { |
|
496 |
x.rethrowAsIOException(file); |
|
497 |
} |
|
498 |
// DOS hidden attribute not meaningful when set on directories |
|
499 |
if (attrs.isDirectory()) |
|
500 |
return false; |
|
501 |
return attrs.isHidden(); |
|
502 |
} |
|
503 |
||
504 |
@Override |
|
505 |
public FileStore getFileStore(Path obj) throws IOException { |
|
506 |
WindowsPath file = WindowsPath.toWindowsPath(obj); |
|
507 |
SecurityManager sm = System.getSecurityManager(); |
|
508 |
if (sm != null) { |
|
509 |
sm.checkPermission(new RuntimePermission("getFileStoreAttributes")); |
|
510 |
file.checkRead(); |
|
511 |
} |
|
512 |
return WindowsFileStore.create(file); |
|
513 |
} |
|
514 |
||
515 |
||
516 |
@Override |
|
517 |
public void createDirectory(Path obj, FileAttribute<?>... attrs) |
|
518 |
throws IOException |
|
519 |
{ |
|
520 |
WindowsPath dir = WindowsPath.toWindowsPath(obj); |
|
521 |
dir.checkWrite(); |
|
522 |
WindowsSecurityDescriptor sd = WindowsSecurityDescriptor.fromAttribute(attrs); |
|
523 |
try { |
|
524 |
CreateDirectory(dir.getPathForWin32Calls(), sd.address()); |
|
525 |
} catch (WindowsException x) { |
|
526 |
x.rethrowAsIOException(dir); |
|
527 |
} finally { |
|
528 |
sd.release(); |
|
529 |
} |
|
530 |
} |
|
531 |
||
532 |
@Override |
|
533 |
public DirectoryStream<Path> newDirectoryStream(Path obj, DirectoryStream.Filter<? super Path> filter) |
|
534 |
throws IOException |
|
535 |
{ |
|
536 |
WindowsPath dir = WindowsPath.toWindowsPath(obj); |
|
537 |
dir.checkRead(); |
|
538 |
if (filter == null) |
|
539 |
throw new NullPointerException(); |
|
540 |
return new WindowsDirectoryStream(dir, filter); |
|
541 |
} |
|
542 |
||
543 |
@Override |
|
544 |
public void createSymbolicLink(Path obj1, Path obj2, FileAttribute<?>... attrs) |
|
545 |
throws IOException |
|
546 |
{ |
|
547 |
WindowsPath link = WindowsPath.toWindowsPath(obj1); |
|
548 |
WindowsPath target = WindowsPath.toWindowsPath(obj2); |
|
549 |
||
550 |
if (!link.getFileSystem().supportsLinks()) { |
|
551 |
throw new UnsupportedOperationException("Symbolic links not supported " |
|
552 |
+ "on this operating system"); |
|
553 |
} |
|
554 |
||
555 |
// no attributes allowed |
|
556 |
if (attrs.length > 0) { |
|
557 |
WindowsSecurityDescriptor.fromAttribute(attrs); // may throw NPE or UOE |
|
558 |
throw new UnsupportedOperationException("Initial file attributes" + |
|
559 |
"not supported when creating symbolic link"); |
|
560 |
} |
|
561 |
||
562 |
// permission check |
|
563 |
SecurityManager sm = System.getSecurityManager(); |
|
564 |
if (sm != null) { |
|
565 |
sm.checkPermission(new LinkPermission("symbolic")); |
|
566 |
link.checkWrite(); |
|
567 |
} |
|
568 |
||
569 |
/** |
|
570 |
* Throw I/O exception for the drive-relative case because Windows |
|
571 |
* creates a link with the resolved target for this case. |
|
572 |
*/ |
|
573 |
if (target.type() == WindowsPathType.DRIVE_RELATIVE) { |
|
574 |
throw new IOException("Cannot create symbolic link to working directory relative target"); |
|
575 |
} |
|
576 |
||
577 |
/* |
|
578 |
* Windows treates symbolic links to directories differently than it |
|
579 |
* does to other file types. For that reason we need to check if the |
|
580 |
* target is a directory (or a directory junction). |
|
581 |
*/ |
|
582 |
WindowsPath resolvedTarget; |
|
583 |
if (target.type() == WindowsPathType.RELATIVE) { |
|
584 |
WindowsPath parent = link.getParent(); |
|
585 |
resolvedTarget = (parent == null) ? target : parent.resolve(target); |
|
586 |
} else { |
|
587 |
resolvedTarget = link.resolve(target); |
|
588 |
} |
|
589 |
int flags = 0; |
|
590 |
try { |
|
591 |
WindowsFileAttributes wattrs = WindowsFileAttributes.get(resolvedTarget, false); |
|
592 |
if (wattrs.isDirectory() || wattrs.isDirectoryLink()) |
|
593 |
flags |= SYMBOLIC_LINK_FLAG_DIRECTORY; |
|
594 |
} catch (WindowsException x) { |
|
595 |
// unable to access target so assume target is not a directory |
|
596 |
} |
|
597 |
||
598 |
// create the link |
|
599 |
try { |
|
600 |
CreateSymbolicLink(link.getPathForWin32Calls(), |
|
601 |
WindowsPath.addPrefixIfNeeded(target.toString()), |
|
602 |
flags); |
|
603 |
} catch (WindowsException x) { |
|
604 |
if (x.lastError() == ERROR_INVALID_REPARSE_DATA) { |
|
605 |
x.rethrowAsIOException(link, target); |
|
606 |
} else { |
|
607 |
x.rethrowAsIOException(link); |
|
608 |
} |
|
609 |
} |
|
610 |
} |
|
611 |
||
612 |
@Override |
|
613 |
public void createLink(Path obj1, Path obj2) throws IOException { |
|
614 |
WindowsPath link = WindowsPath.toWindowsPath(obj1); |
|
615 |
WindowsPath existing = WindowsPath.toWindowsPath(obj2); |
|
616 |
||
617 |
// permission check |
|
618 |
SecurityManager sm = System.getSecurityManager(); |
|
619 |
if (sm != null) { |
|
620 |
sm.checkPermission(new LinkPermission("hard")); |
|
621 |
link.checkWrite(); |
|
622 |
existing.checkWrite(); |
|
623 |
} |
|
624 |
||
625 |
// create hard link |
|
626 |
try { |
|
627 |
CreateHardLink(link.getPathForWin32Calls(), |
|
628 |
existing.getPathForWin32Calls()); |
|
629 |
} catch (WindowsException x) { |
|
630 |
x.rethrowAsIOException(link, existing); |
|
631 |
} |
|
632 |
} |
|
633 |
||
634 |
@Override |
|
635 |
public Path readSymbolicLink(Path obj1) throws IOException { |
|
636 |
WindowsPath link = WindowsPath.toWindowsPath(obj1); |
|
637 |
WindowsFileSystem fs = link.getFileSystem(); |
|
638 |
if (!fs.supportsLinks()) { |
|
639 |
throw new UnsupportedOperationException("symbolic links not supported"); |
|
640 |
} |
|
641 |
||
642 |
// permission check |
|
643 |
SecurityManager sm = System.getSecurityManager(); |
|
644 |
if (sm != null) { |
|
645 |
FilePermission perm = new FilePermission(link.getPathForPermissionCheck(), |
|
646 |
SecurityConstants.FILE_READLINK_ACTION); |
|
647 |
AccessController.checkPermission(perm); |
|
648 |
} |
|
649 |
||
650 |
String target = WindowsLinkSupport.readLink(link); |
|
651 |
return WindowsPath.createFromNormalizedPath(fs, target); |
|
652 |
} |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
diff
changeset
|
653 |
} |