You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by ja...@apache.org on 2013/07/08 11:09:49 UTC
svn commit: r1500616 -
/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java
Author: james-masanz
Date: Mon Jul 8 09:09:48 2013
New Revision: 1500616
URL: http://svn.apache.org/r1500616
Log:
add simple checking for file not exist
Modified:
ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java
Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java?rev=1500616&r1=1500615&r2=1500616&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java (original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java Mon Jul 8 09:09:48 2013
@@ -20,6 +20,13 @@ public class ReadAndPreprocessForAttribu
// Always preprocess something to a main directory, usually for training
String froot = AssertionConst.preprocessRootDirectory.get(source);
if (!(new File(froot).exists())) {
+ File f = new File(froot);
+ if (!f.getParentFile().exists()) {
+ throw new RuntimeException("Can't find parent " + f.getParentFile().getPath());
+ }
+ if (!f.getParentFile().isDirectory()) {
+ throw new RuntimeException("What should be the parent is not a directory " + f.getParentFile().getPath());
+ }
(new File(froot)).createNewFile();
}
params.add("--train-dir"); params.add(froot);