@Test public void should_Append_Txt_Extension_When_Name_Ends_With_Asc_Extension() throws Exception { String contentName = "sample/sample-file-1.23.whl.asc"; pyPiContentValidator.determineContentType(true, null, null, contentName, null); verify(defaultContentValidator) .determineContentType(eq(true), any(), any(), eq(contentName + TEXT_FILE_EXTENSION), any()); }
@Nonnull @Override public String determineContentType(final boolean strictContentTypeValidation, final Supplier<InputStream> contentSupplier, @Nullable final MimeRulesSource mimeRulesSource, @Nullable final String contentName, @Nullable final String declaredContentType) throws IOException { String name = modifyContentNameForSpecialCases(contentName); return defaultContentValidator .determineContentType(strictContentTypeValidation, contentSupplier, mimeRulesSource, name, declaredContentType); }
PyPiContentValidator extends ComponentSupport implements ContentValidator { @Nonnull @Override public String determineContentType(final boolean strictContentTypeValidation, final Supplier<InputStream> contentSupplier, @Nullable final MimeRulesSource mimeRulesSource, @Nullable final String contentName, @Nullable final String declaredContentType) throws IOException { String name = modifyContentNameForSpecialCases(contentName); return defaultContentValidator .determineContentType(strictContentTypeValidation, contentSupplier, mimeRulesSource, name, declaredContentType); } }
PyPiContentValidator extends ComponentSupport implements ContentValidator { @Nonnull @Override public String determineContentType(final boolean strictContentTypeValidation, final Supplier<InputStream> contentSupplier, @Nullable final MimeRulesSource mimeRulesSource, @Nullable final String contentName, @Nullable final String declaredContentType) throws IOException { String name = modifyContentNameForSpecialCases(contentName); return defaultContentValidator .determineContentType(strictContentTypeValidation, contentSupplier, mimeRulesSource, name, declaredContentType); } @Inject  PyPiContentValidator(final DefaultContentValidator defaultContentValidator); }
PyPiContentValidator extends ComponentSupport implements ContentValidator { @Nonnull @Override public String determineContentType(final boolean strictContentTypeValidation, final Supplier<InputStream> contentSupplier, @Nullable final MimeRulesSource mimeRulesSource, @Nullable final String contentName, @Nullable final String declaredContentType) throws IOException { String name = modifyContentNameForSpecialCases(contentName); return defaultContentValidator .determineContentType(strictContentTypeValidation, contentSupplier, mimeRulesSource, name, declaredContentType); } @Inject  PyPiContentValidator(final DefaultContentValidator defaultContentValidator); @Nonnull @Override String determineContentType(final boolean strictContentTypeValidation,
                                     final Supplier<InputStream> contentSupplier,
                                     @Nullable final MimeRulesSource mimeRulesSource,
                                     @Nullable final String contentName,
                                     @Nullable final String declaredContentType); }
PyPiContentValidator extends ComponentSupport implements ContentValidator { @Nonnull @Override public String determineContentType(final boolean strictContentTypeValidation, final Supplier<InputStream> contentSupplier, @Nullable final MimeRulesSource mimeRulesSource, @Nullable final String contentName, @Nullable final String declaredContentType) throws IOException { String name = modifyContentNameForSpecialCases(contentName); return defaultContentValidator .determineContentType(strictContentTypeValidation, contentSupplier, mimeRulesSource, name, declaredContentType); } @Inject  PyPiContentValidator(final DefaultContentValidator defaultContentValidator); @Nonnull @Override String determineContentType(final boolean strictContentTypeValidation,
                                     final Supplier<InputStream> contentSupplier,
                                     @Nullable final MimeRulesSource mimeRulesSource,
                                     @Nullable final String contentName,
                                     @Nullable final String declaredContentType);  }