Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flint-core/src/main/java/uk/bl/dpt/qa/flint/Flint.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.util.Map;
import java.util.Set;

import static uk.bl.dpt.qa.flint.wrappers.TikaWrapper.getMimetype;
import uk.bl.dpt.qa.flint.wrappers.TikaWrapper;
import static uk.bl.dpt.utils.util.FileUtil.traverse;

/**
Expand Down Expand Up @@ -168,7 +168,7 @@ public List<CheckResult> check(File pFile) {

boolean checked = false;

String mimetype = getMimetype(pFile);
String mimetype = new TikaWrapper().getMimetype(pFile);

List<CheckResult> results = new ArrayList<CheckResult>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public class TimedValidation {

private static Logger LOGGER = LoggerFactory.getLogger(TimedValidation.class);

protected static ExecutorService executor;

private TimedValidation(){}

/**
Expand All @@ -49,7 +47,7 @@ private TimedValidation(){}
* @return output from the TimedTask
*/
public static LinkedHashMap<String, CheckCategory> validate(TimedTask task, File contentFile) {
executor = Executors.newSingleThreadExecutor();
ExecutorService executor = Executors.newSingleThreadExecutor();
task.setContentFile(contentFile);
LinkedHashMap<String, CheckCategory> cMap = new LinkedHashMap<String, CheckCategory>();
Future<LinkedHashMap<String, CheckCategory>> future = executor.submit(task);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public PolicyValidation(long timeout, Set<String> patternFilter) {
@Override
public LinkedHashMap<String, CheckCategory> call() throws Exception {
logger.info("Performing a policy validation on {}", contentFile);
StreamSource outputXml = EpubCheckWrapper.check(contentFile);
StreamSource outputXml = new EpubCheckWrapper().check(contentFile);
return PolicyAware.policyValidationResult(outputXml,
new StreamSource(EPUBFormat.getPolicyStatically()), patternFilter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ public LinkedHashMap<String, CheckCategory> call() throws Exception {
LinkedHashMap<String, CheckCategory> cmap = new LinkedHashMap<String, CheckCategory>();
if (patternFilter == null || patternFilter.contains(catName) ) {
CheckCategory cc = new CheckCategory(catName);
if (CalibreWrapper.calibreIsAvailable()) {
CalibreWrapper calibreWrapper = new CalibreWrapper();
if (calibreWrapper.calibreIsAvailable()) {
try {
cc.add(new CheckCheck("isValidCalibre", CalibreWrapper.isValid(contentFile), null));
cc.add(new CheckCheck("isValidCalibre", calibreWrapper.isValid(contentFile), null));
logger.debug(cc.get("isValidCalibre").toString());
} catch (Exception e) {
logger.error(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Map;
import java.util.Set;

import static uk.bl.dpt.qa.flint.wrappers.TikaWrapper.getMimetype;
import uk.bl.dpt.qa.flint.wrappers.TikaWrapper;

/**
* A controller for the flint-fx GUI that directly runs the flint classes.
Expand Down Expand Up @@ -86,7 +86,7 @@ public void askForValidation() {
protected Collection<String> getAvailableFormats() {
Collection<String> formats = null;
try {
formats = Flint.getAvailableFormats(getMimetype(inputFile)).keySet();
formats = Flint.getAvailableFormats(new TikaWrapper().getMimetype(inputFile)).keySet();
} catch (IllegalAccessException | InstantiationException e) {
logger.error(e.getMessage());
popupError(e);
Expand Down
28 changes: 28 additions & 0 deletions flint-mobi/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flint</artifactId>
<groupId>uk.bl.dpt.qa</groupId>
<version>0.9.0-SNAPSHOT</version>
</parent>

<artifactId>flint-mobi</artifactId>

<dependencies>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>flint-core</artifactId>
<version>${project.version}</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>

</dependencies>

</project>
Loading