equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 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 |
24 */ |
24 */ |
25 |
25 |
26 package sun.nio.fs; |
26 package sun.nio.fs; |
27 |
27 |
28 import java.nio.file.Path; |
28 import java.nio.file.Path; |
29 import java.nio.file.Paths; |
|
30 import java.nio.file.spi.FileTypeDetector; |
29 import java.nio.file.spi.FileTypeDetector; |
31 import sun.security.action.GetPropertyAction; |
30 import sun.security.action.GetPropertyAction; |
32 |
31 |
33 /** |
32 /** |
34 * MacOSX implementation of FileSystemProvider |
33 * MacOSX implementation of FileSystemProvider |
44 return new MacOSXFileSystem(this, dir); |
43 return new MacOSXFileSystem(this, dir); |
45 } |
44 } |
46 |
45 |
47 @Override |
46 @Override |
48 FileTypeDetector getFileTypeDetector() { |
47 FileTypeDetector getFileTypeDetector() { |
49 Path userMimeTypes = Paths.get(GetPropertyAction |
48 Path userMimeTypes = Path.of(GetPropertyAction |
50 .privilegedGetProperty("user.home"), ".mime.types"); |
49 .privilegedGetProperty("user.home"), ".mime.types"); |
51 |
50 |
52 return chain(new MimeTypesFileTypeDetector(userMimeTypes), |
51 return chain(new MimeTypesFileTypeDetector(userMimeTypes), |
53 new UTIFileTypeDetector()); |
52 new UTIFileTypeDetector()); |
54 } |
53 } |