equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2016, 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 |
101 } |
101 } |
102 |
102 |
103 @Override |
103 @Override |
104 FileTypeDetector getFileTypeDetector() { |
104 FileTypeDetector getFileTypeDetector() { |
105 String userHome = GetPropertyAction.privilegedGetProperty("user.home"); |
105 String userHome = GetPropertyAction.privilegedGetProperty("user.home"); |
106 Path userMimeTypes = Paths.get(userHome, ".mime.types"); |
106 Path userMimeTypes = Path.of(userHome, ".mime.types"); |
107 Path etcMimeTypes = Paths.get("/etc/mime.types"); |
107 Path etcMimeTypes = Path.of("/etc/mime.types"); |
108 |
108 |
109 return chain(new MimeTypesFileTypeDetector(userMimeTypes), |
109 return chain(new MimeTypesFileTypeDetector(userMimeTypes), |
110 new MimeTypesFileTypeDetector(etcMimeTypes)); |
110 new MimeTypesFileTypeDetector(etcMimeTypes)); |
111 } |
111 } |
112 } |
112 } |