ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1813313 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java
Date Wed, 25 Oct 2017 15:03:32 GMT
Author: seanfinan
Date: Wed Oct 25 15:03:31 2017
New Revision: 1813313

URL: http://svn.apache.org/viewvc?rev=1813313&view=rev
Log:
Change from deprecated FileLocator.locateFile(..) to getFile(..)
Remove use of deprecated getCasInitializer()

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java?rev=1813313&r1=1813312&r2=1813313&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java
Wed Oct 25 15:03:31 2017
@@ -110,7 +110,7 @@ public class FilesInDirectoryCollectionR
       final String inputDirPath = (String)getConfigParameterValue( ConfigParameterConstants.PARAM_INPUTDIR
);
       File directory;
       try {
-			directory = FileLocator.locateFile( inputDirPath );
+			directory = FileLocator.getFile( inputDirPath );
 		} catch ( IOException ioE ) {
 			throw new ResourceInitializationException(
 					ResourceConfigurationException.DIRECTORY_NOT_FOUND,
@@ -227,13 +227,6 @@ public class FilesInDirectoryCollectionR
 		    documentIDAnnotation.setDocumentID(docID);
 		    documentIDAnnotation.addToIndexes();
 
-	      	//if there's a CAS Initializer, call it	
-			if (getCasInitializer() != null)
-			{
-				getCasInitializer().initializeCas(fileReader, aCAS);	
-			}
-			else  //No CAS Initializer, so read file and set document text ourselves
-			{				
 				byte[] contents = new byte[(int)file.length() ];
 				fileInputStream.read( contents );   
 				String text;
@@ -247,9 +240,8 @@ public class FilesInDirectoryCollectionR
 				}
 				//put document in CAS (assume CAS)
 				jcas.setDocumentText(text);
-			}
-	   
-		    //set language if it was explicitly specified as a configuration parameter
+
+			 //set language if it was explicitly specified as a configuration parameter
 		    if (iv_language != null)
 		    {
 		//      ((DocumentAnnotation)jcas.getDocumentAnnotationFs()).setLanguage(iv_language);



Mime
View raw message