HtmlFileViewer extends HdfsFileViewer { @Override public Set<Capability> getCapabilities(final FileSystem fs, final Path path) throws AccessControlException { final String fileName = path.getName(); final int pos = fileName.lastIndexOf('.'); if (pos < 0) { return EnumSet.noneOf(Capability.class); } final String suffix = fileName.substring(pos).toLowerCase(); if (this.acceptedSuffix.contains(suffix)) { return EnumSet.of(Capability.READ); } else { return EnumSet.noneOf(Capability.class); } } HtmlFileViewer(); @Override String getName(); @Override Set<Capability> getCapabilities(final FileSystem fs, final Path path); @Override void displayFile(final FileSystem fs, final Path path, final OutputStream outputStream,
      final int startLine, final int endLine); @Override ContentType getContentType();  }
@Test public void testCapabilities() throws AccessControlException { Set<Capability> capabilities = this.viewer .getCapabilities(this.fs, getResourcePath(EMPTY_HTM)); assertTrue(capabilities.contains(Capability.READ)); assertEquals(capabilities.size(), 1); capabilities = this.viewer.getCapabilities(this.fs, getResourcePath(VALID_HTML)); assertTrue(capabilities.contains(Capability.READ)); assertEquals(capabilities.size(), 1); }