Repository navigation
Expand file tree
/
Copy pathAttributes.java
More file actions
703 lines (683 loc) · 28.1 KB
/
Copy pathAttributes.java
File metadata and controls
703 lines (683 loc) · 28.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
/*
* Copyright 2007-2009 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.nio.file.attribute;
import java.nio.file.*;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* This class consists exclusively of static methods that operate on or return
* the attributes of files or file stores. These methods provide for convenient
* use of the {@link AttributeView attribute-views} defined in this package.
*
* @since 1.7
*/
public final class Attributes {
private Attributes() {
}
/**
* Splits the given attribute name into the name of an attribute view and
* the attribute. If the attribute view is not identified then it assumed
* to be "basic".
*/
private static String[] split(String attribute) {
String[] s = new String[2];
int pos = attribute.indexOf(':');
if (pos == -1) {
s[0] = "basic";
s[1] = attribute;
} else {
s[0] = attribute.substring(0, pos++);
s[1] = (pos == attribute.length()) ? "" : attribute.substring(pos);
}
return s;
}
/**
* Sets the value of a file attribute.
*
* <p> The {@code attribute} parameter identifies the attribute to be set
* and takes the form:
* <blockquote>
* [<i>view-name</i><b>:</b>]<i>attribute-name</i>
* </blockquote>
* where square brackets [...] delineate an optional component and the
* character {@code ':'} stands for itself.
*
* <p> <i>view-name</i> is the {@link FileAttributeView#name name} of a {@link
* FileAttributeView} that identifies a set of file attributes. If not
* specified then it defaults to {@code "basic"}, the name of the file
* attribute view that identifies the basic set of file attributes common to
* many file systems. <i>attribute-name</i> is the name of the attribute
* within the set.
*
* <p> <b>Usage Example:</b>
* Suppose we want to set the DOS "hidden" attribute:
* <pre>
* Attributes.setAttribute(file, "dos:hidden", true);
* </pre>
*
* @param file
* A file reference that locates the file
* @param attribute
* The attribute to set
* @param value
* The attribute value
*
* @throws UnsupportedOperationException
* If the attribute view is not available or it does not
* support updating the attribute
* @throws IllegalArgumentException
* If the attribute value is of the correct type but has an
* inappropriate value
* @throws ClassCastException
* If the attribute value is not of the expected type or is a
* collection containing elements that are not of the expected
* type
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file. If this method is invoked
* to set security sensitive attributes then the security manager
* may be invoked to check for additional permissions.
*/
public static void setAttribute(FileRef file, String attribute, Object value)
throws IOException
{
String[] s = split(attribute);
FileAttributeView view = file.getFileAttributeView(s[0]);
if (view == null)
throw new UnsupportedOperationException("View '" + s[0] + "' not available");
view.setAttribute(s[1], value);
}
/**
* Reads the value of a file attribute.
*
* <p> The {@code attribute} parameter identifies the attribute to be read
* and takes the form:
* <blockquote>
* [<i>view-name</i><b>:</b>]<i>attribute-name</i>
* </blockquote>
* where square brackets [...] delineate an optional component and the
* character {@code ':'} stands for itself.
*
* <p> <i>view-name</i> is the {@link FileAttributeView#name name} of a {@link
* FileAttributeView} that identifies a set of file attributes. If not
* specified then it defaults to {@code "basic"}, the name of the file
* attribute view that identifies the basic set of file attributes common to
* many file systems. <i>attribute-name</i> is the name of the attribute.
*
* <p> The {@code options} array may be used to indicate how symbolic links
* are handled for the case that the file is a symbolic link. By default,
* symbolic links are followed and the file attribute of the final target
* of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS
* NOFOLLOW_LINKS} is present then symbolic links are not followed and so
* the method returns the file attribute of the symbolic link.
*
* <p> <b>Usage Example:</b>
* Suppose we require the user ID of the file owner on a system that
* supports a "{@code unix}" view:
* <pre>
* int uid = (Integer)Attributes.getAttribute(file, "unix:uid");
* </pre>
*
* @param file
* A file reference that locates the file
* @param attribute
* The attribute to read
* @param options
* Options indicating how symbolic links are handled
*
* @return The attribute value, or {@code null} if the attribute view
* is not available or it does not support reading the attribute
*
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, its {@link SecurityManager#checkRead(String) checkRead}
* method denies read access to the file. If this method is invoked
* to read security sensitive attributes then the security manager
* may be invoked to check for additional permissions.
*/
public static Object getAttribute(FileRef file,
String attribute,
LinkOption... options)
throws IOException
{
String[] s = split(attribute);
FileAttributeView view = file.getFileAttributeView(s[0], options);
if (view != null)
return view.getAttribute(s[1]);
// view not available
return null;
}
/**
* Reads a set of file attributes as a bulk operation.
*
* <p> The {@code attributes} parameter identifies the attributes to be read
* and takes the form:
* <blockquote>
* [<i>view-name</i><b>:</b>]<i>attribute-list</i>
* </blockquote>
* where square brackets [...] delineate an optional component and the
* character {@code ':'} stands for itself.
*
* <p> <i>view-name</i> is the {@link FileAttributeView#name name} of a {@link
* FileAttributeView} that identifies a set of file attributes. If not
* specified then it defaults to {@code "basic"}, the name of the file
* attribute view that identifies the basic set of file attributes common to
* many file systems.
*
* <p> The <i>attribute-list</i> component is a comma separated list of
* zero or more names of attributes to read. If the list contains the value
* {@code "*"} then all attributes are read. Attributes that are not supported
* are ignored and will not be present in the returned map. It is
* implementation specific if all attributes are read as an atomic operation
* with respect to other file system operations.
*
* <p> The following examples demonstrate possible values for the {@code
* attributes} parameter:
*
* <blockquote>
* <table border="0">
* <tr>
* <td> {@code "*"} </td>
* <td> Read all {@link BasicFileAttributes basic-file-attributes}. </td>
* </tr>
* <tr>
* <td> {@code "size,lastModifiedTime,lastAccessTime"} </td>
* <td> Reads the file size, last modified time, and last access time
* attributes. </td>
* </tr>
* <tr>
* <td> {@code "posix:*"} </td>
* <td> Read all {@link PosixFileAttributes POSIX-file-attributes}.. </td>
* </tr>
* <tr>
* <td> {@code "posix:permissions,owner,size"} </td>
* <td> Reads the POSX file permissions, owner, and file size. </td>
* </tr>
* </table>
* </blockquote>
*
* <p> The {@code options} array may be used to indicate how symbolic links
* are handled for the case that the file is a symbolic link. By default,
* symbolic links are followed and the file attributes of the final target
* of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS
* NOFOLLOW_LINKS} is present then symbolic links are not followed and so
* the method returns the file attributes of the symbolic link.
*
* @param file
* A file reference that locates the file
* @param attributes
* The attributes to read
* @param options
* Options indicating how symbolic links are handled
*
* @return A map of the attributes returned; may be empty. The map's keys
* are the attribute names, its values are the attribute values
*
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, its {@link SecurityManager#checkRead(String) checkRead}
* method denies read access to the file. If this method is invoked
* to read security sensitive attributes then the security manager
* may be invoke to check for additional permissions.
*/
public static Map<String,?> readAttributes(FileRef file,
String attributes,
LinkOption... options)
throws IOException
{
String[] s = split(attributes);
FileAttributeView view = file.getFileAttributeView(s[0], options);
if (view != null) {
// further split attributes into the first and rest.
String[] names = s[1].split(",");
int rem = names.length-1;
String first = names[0];
String[] rest = new String[rem];
if (rem > 0) System.arraycopy(names, 1, rest, 0, rem);
return view.readAttributes(first, rest);
}
// view not available
return Collections.emptyMap();
}
/**
* Reads the basic file attributes of a file.
*
* <p> The {@code options} array may be used to indicate how symbolic links
* are handled for the case that the file is a symbolic link. By default,
* symbolic links are followed and the file attributes of the final target
* of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS
* NOFOLLOW_LINKS} is present then symbolic links are not followed and so
* the method returns the file attributes of the symbolic link. This option
* should be used where there is a need to determine if a file is a
* symbolic link:
* <pre>
* boolean isSymbolicLink = Attributes.readBasicFileAttributes(file, NOFOLLOW_LINKS).isSymbolicLink();
* </pre>
*
* <p> It is implementation specific if all file attributes are read as an
* atomic operation with respect to other file system operations.
*
* @param file
* A file reference that locates the file
* @param options
* Options indicating how symbolic links are handled
*
* @return The basic file attributes
*
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, the security manager's {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to file
*
* @see BasicFileAttributeView#readAttributes
*/
public static BasicFileAttributes readBasicFileAttributes(FileRef file,
LinkOption... options)
throws IOException
{
return file.getFileAttributeView(BasicFileAttributeView.class, options)
.readAttributes();
}
/**
* Reads the POSIX file attributes of a file.
*
* <p> The {@code file} parameter locates a file that supports the {@link
* PosixFileAttributeView}. This file attribute view provides access to a
* subset of the file attributes commonly associated with files on file
* systems used by operating systems that implement the Portable Operating
* System Interface (POSIX) family of standards. It is implementation
* specific if all file attributes are read as an atomic operation with
* respect to other file system operations.
*
* <p> The {@code options} array may be used to indicate how symbolic links
* are handled for the case that the file is a symbolic link. By default,
* symbolic links are followed and the file attributes of the final target
* of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS
* NOFOLLOW_LINKS} is present then symbolic links are not followed and so
* the method returns the file attributes of the symbolic link.
*
* @param file
* A file reference that locates the file
* @param options
* Options indicating how symbolic links are handled
*
* @return The POSIX file attributes
*
* @throws UnsupportedOperationException
* If the {@code PosixFileAttributeView} is not available
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*
* @see PosixFileAttributeView#readAttributes
*/
public static PosixFileAttributes readPosixFileAttributes(FileRef file,
LinkOption... options)
throws IOException
{
PosixFileAttributeView view =
file.getFileAttributeView(PosixFileAttributeView.class, options);
if (view == null)
throw new UnsupportedOperationException();
return view.readAttributes();
}
/**
* Reads the DOS file attributes of a file.
*
* <p> The {@code file} parameter locates a file that supports the {@link
* DosFileAttributeView}. This file attribute view provides access to
* legacy "DOS" attributes supported by the file systems such as File
* Allocation Table (FAT), commonly used in <em>consumer devices</em>. It is
* implementation specific if all file attributes are read as an atomic
* operation with respect to other file system operations.
*
* <p> The {@code options} array may be used to indicate how symbolic links
* are handled for the case that the file is a symbolic link. By default,
* symbolic links are followed and the file attributes of the final target
* of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS
* NOFOLLOW_LINKS} is present then symbolic links are not followed and so
* the method returns the file attributes of the symbolic link.
*
* @param file
* A file reference that locates the file
* @param options
* Options indicating how symbolic links are handled
*
* @return The DOS file attributes
*
* @throws UnsupportedOperationException
* If the {@code DosFileAttributeView} is not available
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, the security manager's {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to file
*
* @see DosFileAttributeView#readAttributes
*/
public static DosFileAttributes readDosFileAttributes(FileRef file,
LinkOption... options)
throws IOException
{
DosFileAttributeView view =
file.getFileAttributeView(DosFileAttributeView.class, options);
if (view == null)
throw new UnsupportedOperationException();
return view.readAttributes();
}
/**
* Returns the owner of a file.
*
* <p> The {@code file} parameter locates a file that supports the {@link
* FileOwnerAttributeView}. This file attribute view provides access to
* a file attribute that is the owner of the file.
*
* @param file
* A file reference that locates the file
*
* @return A user principal representing the owner of the file
*
* @throws UnsupportedOperationException
* If the {@code FileOwnerAttributeView} is not available
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*
* @see FileOwnerAttributeView#getOwner
*/
public static UserPrincipal getOwner(FileRef file) throws IOException {
FileOwnerAttributeView view =
file.getFileAttributeView(FileOwnerAttributeView.class);
if (view == null)
throw new UnsupportedOperationException();
return view.getOwner();
}
/**
* Updates the file owner.
*
* <p> The {@code file} parameter locates a file that supports the {@link
* FileOwnerAttributeView}. This file attribute view provides access to
* a file attribute that is the owner of the file.
*
* @param file
* A file reference that locates the file
* @param owner
* The new file owner
*
* @throws UnsupportedOperationException
* If the {@code FileOwnerAttributeView} is not available
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*
* @see FileOwnerAttributeView#setOwner
*/
public static void setOwner(FileRef file, UserPrincipal owner)
throws IOException
{
FileOwnerAttributeView view =
file.getFileAttributeView(FileOwnerAttributeView.class);
if (view == null)
throw new UnsupportedOperationException();
view.setOwner(owner);
}
/**
* Reads a file's Access Control List (ACL).
*
* <p> The {@code file} parameter locates a file that supports the {@link
* AclFileAttributeView}. This file attribute view provides access to ACLs
* based on the ACL model specified in
* <a href="http://www.ietf.org/rfc/rfc3530.txt"><i>RFC 3530</i></a>.
*
* @param file
* A file reference that locates the file
*
* @return An ordered list of {@link AclEntry entries} representing the
* ACL. The returned list is modifiable.
*
* @throws UnsupportedOperationException
* If the {@code AclAttributeView} is not available
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
* or its {@link SecurityManager#checkRead(String) checkRead} method
* denies read access to the file.
*
* @see AclFileAttributeView#getAcl
*/
public static List<AclEntry> getAcl(FileRef file) throws IOException {
AclFileAttributeView view =
file.getFileAttributeView(AclFileAttributeView.class);
if (view == null)
throw new UnsupportedOperationException();
return view.getAcl();
}
/**
* Updates a file's Access Control List (ACL).
*
* <p> The {@code file} parameter locates a file that supports the {@link
* AclFileAttributeView}. This file attribute view provides access to ACLs
* based on the ACL model specified in
* <a href="http://www.ietf.org/rfc/rfc3530.txt"><i>RFC 3530</i></a>.
*
* @param file
* A file reference that locates the file
* @param acl
* The new file ACL
*
* @throws UnsupportedOperationException
* If the {@code AclFileAttributeView} is not available
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*
* @see AclFileAttributeView#setAcl
*/
public static void setAcl(FileRef file, List<AclEntry> acl)
throws IOException
{
AclFileAttributeView view =
file.getFileAttributeView(AclFileAttributeView.class);
if (view == null)
throw new UnsupportedOperationException();
view.setAcl(acl);
}
/**
* Updates the value of a file's last modified time attribute.
*
* <p> The time value is measured since the epoch
* (00:00:00 GMT, January 1, 1970) and is converted to the precision supported
* by the file system. Converting from finer to coarser granularities result
* in precision loss.
*
* <p> If the file system does not support a last modified time attribute then
* this method has no effect.
*
* @param file
* A file reference that locates the file
*
* @param lastModifiedTime
* The new last modified time, or {@code -1L} to update it to
* the current time
* @param unit
* A {@code TimeUnit} determining how to interpret the
* {@code lastModifiedTime} parameter
*
* @throws IllegalArgumentException
* If the {@code lastModifiedime} parameter is a negative value other
* than {@code -1L}
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, the security manager's {@link
* SecurityManager#checkWrite(String) checkWrite} method is invoked
* to check write access to file
*
* @see BasicFileAttributeView#setTimes
*/
public static void setLastModifiedTime(FileRef file,
long lastModifiedTime,
TimeUnit unit)
throws IOException
{
file.getFileAttributeView(BasicFileAttributeView.class)
.setTimes(lastModifiedTime, null, null, unit);
}
/**
* Updates the value of a file's last access time attribute.
*
* <p> The time value is measured since the epoch
* (00:00:00 GMT, January 1, 1970) and is converted to the precision supported
* by the file system. Converting from finer to coarser granularities result
* in precision loss.
*
* <p> If the file system does not support a last access time attribute then
* this method has no effect.
*
* @param lastAccessTime
* The new last access time, or {@code -1L} to update it to
* the current time
* @param unit
* A {@code TimeUnit} determining how to interpret the
* {@code lastModifiedTime} parameter
*
* @throws IllegalArgumentException
* If the {@code lastAccessTime} parameter is a negative value other
* than {@code -1L}
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, the security manager's {@link
* SecurityManager#checkWrite(String) checkWrite} method is invoked
* to check write access to file
*
* @see BasicFileAttributeView#setTimes
*/
public static void setLastAccessTime(FileRef file,
long lastAccessTime,
TimeUnit unit)
throws IOException
{
file.getFileAttributeView(BasicFileAttributeView.class)
.setTimes(null, lastAccessTime, null, unit);
}
/**
* Sets a file's POSIX permissions.
*
* <p> The {@code file} parameter is a reference to an existing file. It
* supports the {@link PosixFileAttributeView} that provides access to file
* attributes commonly associated with files on file systems used by
* operating systems that implement the Portable Operating System Interface
* (POSIX) family of standards.
*
* @param file
* A file reference that locates the file
* @param perms
* The new set of permissions
*
* @throws UnsupportedOperationException
* If {@code PosixFileAttributeView} is not available
* @throws ClassCastException
* If the sets contains elements that are not of type {@code
* PosixFilePermission}
* @throws IOException
* If an I/O error occurs
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, it denies {@link RuntimePermission}<tt>("accessUserInformation")</tt>
* or its {@link SecurityManager#checkWrite(String) checkWrite}
* method denies write access to the file.
*
* @see PosixFileAttributeView#setPermissions
*/
public static void setPosixFilePermissions(FileRef file,
Set<PosixFilePermission> perms)
throws IOException
{
PosixFileAttributeView view =
file.getFileAttributeView(PosixFileAttributeView.class);
if (view == null)
throw new UnsupportedOperationException();
view.setPermissions(perms);
}
/**
* Reads the space attributes of a file store.
*
* <p> The {@code store} parameter is a file store that supports the
* {@link FileStoreSpaceAttributeView} providing access to the space related
* attributes of the file store. It is implementation specific if all attributes
* are read as an atomic operation with respect to other file system operations.
*
* @param store
* The file store
*
* @return The file store space attributes
*
* @throws UnsupportedOperationException
* If the file store space attribute view is not supported
* @throws IOException
* If an I/O error occurs
*
* @see FileStoreSpaceAttributeView#readAttributes()
*/
public static FileStoreSpaceAttributes readFileStoreSpaceAttributes(FileStore store)
throws IOException
{
FileStoreSpaceAttributeView view =
store.getFileStoreAttributeView(FileStoreSpaceAttributeView.class);
if (view == null)
throw new UnsupportedOperationException();
return view.readAttributes();
}
}