Skip to content

Commit

Permalink
ANY23-365 resolved additional warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HansBrende committed Jul 11, 2018
1 parent 5a2613b commit 3f87cf3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions api/src/main/java/org/apache/any23/plugin/Author.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@

package org.apache.any23.plugin;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Describes the author of the plugin.
*
* @author Michele Mostarda ([email protected])
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface Author {

/**
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main/java/org/apache/any23/cli/PluginVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ private String getMimeTypesStr(Collection<MIMEType> mimeTypes) {
return sb.toString();
}

private void printPluginData(ExtractorFactory extractorFactory, PrintStream ps) {
private void printPluginData(ExtractorFactory<?> extractorFactory, PrintStream ps) {
final Author authorAnnotation = extractorFactory.getClass().getAnnotation(Author.class);
ps.printf("Plugin author : %s%n", authorAnnotation == null ? "<unknown>" : authorAnnotation.name());
ps.printf("Plugin factory : %s%n", extractorFactory.getClass());
ps.printf("Plugin mime-types: %s%n", getMimeTypesStr( extractorFactory.getSupportedMIMETypes() ));
ps.printf("Plugin mime-types: %s%n", getMimeTypesStr(extractorFactory.getSupportedMIMETypes()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand All @@ -45,7 +46,6 @@
import org.apache.any23.writer.TripleHandlerException;
import org.apache.any23.writer.WriterFactory;
import org.apache.any23.writer.WriterFactoryRegistry;
import sun.security.validator.ValidatorException;

/**
* This class is responsible for building the {@link Servlet}
Expand Down Expand Up @@ -127,7 +127,7 @@ public void runExtraction(
}
} catch (IOException ioe) {
// IO Error.
if (ioe.getCause() != null && ValidatorException.class.equals(ioe.getCause().getClass())) {
if (ioe.getCause() instanceof CertificateException) {
final String errMsg = "Could not fetch input, IO Error.";
any23servlet.log(errMsg, ioe.getCause());
sendError(502, errMsg, ioe, null, report);
Expand Down

0 comments on commit 3f87cf3

Please sign in to comment.