本文整理汇总了Java中org.galagosearch.tupleflow.execution.ErrorHandler.addError方法的典型用法代码示例。如果您正苦于以下问题:Java ErrorHandler.addError方法的具体用法?Java ErrorHandler.addError怎么用?Java ErrorHandler.addError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.galagosearch.tupleflow.execution.ErrorHandler
的用法示例。
在下文中一共展示了ErrorHandler.addError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("ManifestWriter requires a 'filename' parameter.");
return;
}
File f = new File(parameters.getXML().get("filename"));
if (f.isFile() && f.canWrite()) {
return; // good news
}
if (f.isDirectory()) {
handler.addError("Pathname " + f.toString() + " exists, and it is a directory, but " +
"ManifestWriter would like to write a file there.");
return;
}
// this will search upwards and verify that we can make
// the necessary directory structure to store this file.
Verification.requireWriteableFile(f.toString(), handler);
}
示例2: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("DocumentLengthsWriter requires an 'filename' parameter.");
return;
}
String filename = parameters.getXML().get("filename");
Verification.requireWriteableFile(filename, handler);
}
示例3: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("PositionsListWriter requires an 'filename' parameter.");
return;
}
String index = parameters.getXML().get("filename");
Verification.requireWriteableFile(index, handler);
}
示例4: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("DocumentIndexWriter requires an 'filename' parameter.");
return;
}
String index = parameters.getXML().get("filename");
Verification.requireWriteableFile(index, handler);
}
示例5: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!Verification.requireParameters(new String[]{"filename"}, parameters.getXML(), handler)) {
return;
}
String filename = parameters.getXML().get("filename");
if (!new File(filename).isFile()) {
handler.addError("File " + filename + " does not exist.");
}
}
示例6: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!(parameters.getXML().containsKey("directory") || parameters.getXML().containsKey("filename"))) {
handler.addError("FileSource requires either at least one directory or filename parameter.");
return;
}
if (parameters.getXML().containsKey("directory")) {
List<Value> directories = parameters.getXML().list("directory");
for (Value directory : directories) {
File directoryFile = new File(directory.toString());
if (directoryFile.exists() == false) {
handler.addError("Directory " + directoryFile.toString() + " doesn't exist.");
} else if (directoryFile.isDirectory() == false) {
handler.addError(directoryFile.toString() + " exists, but it isn't a directory.");
}
}
} else if (parameters.getXML().containsKey("filename")) {
List<Value> files = parameters.getXML().list("filename");
for (Value file : files) {
File f = new File(file.toString());
if (f.exists() == false) {
handler.addError("File " + file.toString() + " doesn't exist.");
} else if (f.isFile() == false) {
handler.addError(file.toString() + " exists, but isn't a file.");
}
}
}
}
示例7: verify
import org.galagosearch.tupleflow.execution.ErrorHandler; //导入方法依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!parameters.getXML().containsKey("filename")) {
handler.addError("DocumentNameWriter requires an 'filename' parameter.");
return;
}
}