equal
deleted
inserted
replaced
28 import java.nio.file.FileStore; |
28 import java.nio.file.FileStore; |
29 import java.nio.file.FileSystem; |
29 import java.nio.file.FileSystem; |
30 import java.nio.file.attribute.FileAttributeView; |
30 import java.nio.file.attribute.FileAttributeView; |
31 import java.nio.file.attribute.BasicFileAttributeView; |
31 import java.nio.file.attribute.BasicFileAttributeView; |
32 import java.nio.file.attribute.FileStoreAttributeView; |
32 import java.nio.file.attribute.FileStoreAttributeView; |
|
33 import java.util.Objects; |
33 |
34 |
34 /** |
35 /** |
35 * File store implementation for jrt file systems. |
36 * File store implementation for jrt file systems. |
36 * |
37 * |
37 * @implNote This class needs to maintain JDK 8 source compatibility. |
38 * @implNote This class needs to maintain JDK 8 source compatibility. |
42 */ |
43 */ |
43 final class JrtFileStore extends FileStore { |
44 final class JrtFileStore extends FileStore { |
44 |
45 |
45 protected final FileSystem jrtfs; |
46 protected final FileSystem jrtfs; |
46 |
47 |
47 JrtFileStore(AbstractJrtPath jrtPath) { |
48 JrtFileStore(JrtPath jrtPath) { |
48 this.jrtfs = jrtPath.getFileSystem(); |
49 this.jrtfs = jrtPath.getFileSystem(); |
49 } |
50 } |
50 |
51 |
51 @Override |
52 @Override |
52 public String name() { |
53 public String name() { |
69 } |
70 } |
70 |
71 |
71 @Override |
72 @Override |
72 @SuppressWarnings("unchecked") |
73 @SuppressWarnings("unchecked") |
73 public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) { |
74 public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) { |
74 if (type == null) { |
75 Objects.requireNonNull(type, "type"); |
75 throw new NullPointerException(); |
|
76 } |
|
77 return (V) null; |
76 return (V) null; |
78 } |
77 } |
79 |
78 |
80 @Override |
79 @Override |
81 public long getTotalSpace() throws IOException { |
80 public long getTotalSpace() throws IOException { |
97 throw new UnsupportedOperationException("does not support " + attribute); |
96 throw new UnsupportedOperationException("does not support " + attribute); |
98 } |
97 } |
99 |
98 |
100 @Override |
99 @Override |
101 public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) { |
100 public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) { |
102 return (type == BasicFileAttributeView.class |
101 return type == BasicFileAttributeView.class || |
103 || type == JrtFileAttributeView.class); |
102 type == JrtFileAttributeView.class; |
104 } |
103 } |
105 } |
104 } |