Example usage for opennlp.tools.cmdline TerminateToolException TerminateToolException

List of usage examples for opennlp.tools.cmdline TerminateToolException TerminateToolException

Introduction

In this page you can find the example usage for opennlp.tools.cmdline TerminateToolException TerminateToolException.

Prototype

public TerminateToolException(int code, String message) 

Source Link

Usage

From source file:es.ehu.si.ixa.pipe.nerc.train.InputOutputUtils.java

private static void checkInputFile(String name, File inFile) {

    String isFailure = null;//  w  w w . j  ava  2s .  c o m

    if (inFile.isDirectory()) {
        isFailure = "The " + name + " file is a directory!";
    } else if (!inFile.exists()) {
        isFailure = "The " + name + " file does not exist!";
    } else if (!inFile.canRead()) {
        isFailure = "No permissions to read the " + name + " file!";
    }

    if (null != isFailure) {
        throw new TerminateToolException(-1, isFailure + " Path: " + inFile.getAbsolutePath());
    }
}