67 } 68 return super.getFileAttributeView(obj, type, options); 69 } 70 71 @Override 72 public DynamicFileAttributeView getFileAttributeView(Path obj, 73 String name, 74 LinkOption... options) 75 { 76 if (name.equals("acl")) 77 return new SolarisAclFileAttributeView(UnixPath.toUnixPath(obj), 78 Util.followLinks(options)); 79 if (name.equals("user")) 80 return new SolarisUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), 81 Util.followLinks(options)); 82 return super.getFileAttributeView(obj, name, options); 83 } 84 85 @Override 86 FileTypeDetector getFileTypeDetector() { 87 Path userMimeTypes = Paths.get( 88 GetPropertyAction.privilegedGetProperty("user.home"), ".mime.types"); 89 Path etcMimeTypes = Paths.get("/etc/mime.types"); 90 91 return chain(new MimeTypesFileTypeDetector(userMimeTypes), 92 new MimeTypesFileTypeDetector(etcMimeTypes)); 93 } 94 } | 67 } 68 return super.getFileAttributeView(obj, type, options); 69 } 70 71 @Override 72 public DynamicFileAttributeView getFileAttributeView(Path obj, 73 String name, 74 LinkOption... options) 75 { 76 if (name.equals("acl")) 77 return new SolarisAclFileAttributeView(UnixPath.toUnixPath(obj), 78 Util.followLinks(options)); 79 if (name.equals("user")) 80 return new SolarisUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), 81 Util.followLinks(options)); 82 return super.getFileAttributeView(obj, name, options); 83 } 84 85 @Override 86 FileTypeDetector getFileTypeDetector() { 87 Path userMimeTypes = Path.get( 88 GetPropertyAction.privilegedGetProperty("user.home"), ".mime.types"); 89 Path etcMimeTypes = Path.get("/etc/mime.types"); 90 91 return chain(new MimeTypesFileTypeDetector(userMimeTypes), 92 new MimeTypesFileTypeDetector(etcMimeTypes)); 93 } 94 } |