equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, 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 |
25 |
25 |
26 package sun.nio.fs; |
26 package sun.nio.fs; |
27 |
27 |
28 import java.io.IOException; |
28 import java.io.IOException; |
29 import java.nio.file.Path; |
29 import java.nio.file.Path; |
30 import java.security.AccessController; |
|
31 import java.security.PrivilegedAction; |
|
32 |
30 |
33 /** |
31 /** |
34 * File type detector that uses a file extension to look up its MIME type |
32 * File type detector that uses a file extension to look up its MIME type |
35 * via the Apple Uniform Type Identifier interfaces. |
33 * via the Apple Uniform Type Identifier interfaces. |
36 */ |
34 */ |
53 |
51 |
54 return probe0(ext); |
52 return probe0(ext); |
55 } |
53 } |
56 |
54 |
57 static { |
55 static { |
58 AccessController.doPrivileged(new PrivilegedAction<>() { |
56 jdk.internal.loader.BootLoader.loadLibrary("nio"); |
59 @Override |
|
60 public Void run() { |
|
61 System.loadLibrary("nio"); |
|
62 return null; |
|
63 } |
|
64 }); |
|
65 } |
57 } |
66 } |
58 } |