@Test(expected = IllegalArgumentException.class) public void extractContentType_NOT_SUPPORTED() { contentTypeExtractor.extractContentType("filename.zip"); }
public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }
ContentTypeExtractor { public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); } }
ContentTypeExtractor { public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }  }
ContentTypeExtractor { public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }  ContentType extractContentType(String filename); }
ContentTypeExtractor { public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }  ContentType extractContentType(String filename);  }