72 73 @Override 74 public boolean supportsFileAttributeView(String name) { 75 return name.equals("basic") || name.equals("zip"); 76 } 77 78 @Override 79 @SuppressWarnings("unchecked") 80 public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) { 81 if (type == null) 82 throw new NullPointerException(); 83 return (V)null; 84 } 85 86 @Override 87 public long getTotalSpace() throws IOException { 88 return new ZipFileStoreAttributes(this).totalSpace(); 89 } 90 91 @Override 92 public long getUsableSpace() throws IOException { 93 return new ZipFileStoreAttributes(this).usableSpace(); 94 } 95 96 @Override 97 public long getUnallocatedSpace() throws IOException { 98 return new ZipFileStoreAttributes(this).unallocatedSpace(); 99 } 100 101 @Override 102 public Object getAttribute(String attribute) throws IOException { 103 if (attribute.equals("totalSpace")) 104 return getTotalSpace(); 105 if (attribute.equals("usableSpace")) 106 return getUsableSpace(); 107 if (attribute.equals("unallocatedSpace")) 108 return getUnallocatedSpace(); 109 throw new UnsupportedOperationException("does not support the given attribute"); 110 } 111 | 72 73 @Override 74 public boolean supportsFileAttributeView(String name) { 75 return name.equals("basic") || name.equals("zip"); 76 } 77 78 @Override 79 @SuppressWarnings("unchecked") 80 public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) { 81 if (type == null) 82 throw new NullPointerException(); 83 return (V)null; 84 } 85 86 @Override 87 public long getTotalSpace() throws IOException { 88 return new ZipFileStoreAttributes(this).totalSpace(); 89 } 90 91 @Override 92 public int getBlockSize() throws IOException { 93 throw new UnsupportedOperationException("getBlockSize"); 94 } 95 96 @Override 97 public long getUsableSpace() throws IOException { 98 return new ZipFileStoreAttributes(this).usableSpace(); 99 } 100 101 @Override 102 public long getUnallocatedSpace() throws IOException { 103 return new ZipFileStoreAttributes(this).unallocatedSpace(); 104 } 105 106 @Override 107 public Object getAttribute(String attribute) throws IOException { 108 if (attribute.equals("totalSpace")) 109 return getTotalSpace(); 110 if (attribute.equals("usableSpace")) 111 return getUsableSpace(); 112 if (attribute.equals("unallocatedSpace")) 113 return getUnallocatedSpace(); 114 throw new UnsupportedOperationException("does not support the given attribute"); 115 } 116 |