ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From james-mas...@apache.org
Subject svn commit: r1500616 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/ReadAndPreprocessForAttributeModels.java
Date Mon, 08 Jul 2013 09:09:49 GMT
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);



Mime
View raw message