Return-Path: Delivered-To: apmail-uima-commits-archive@www.apache.org Received: (qmail 42434 invoked from network); 21 Sep 2010 21:06:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Sep 2010 21:06:04 -0000 Received: (qmail 61191 invoked by uid 500); 21 Sep 2010 21:06:04 -0000 Delivered-To: apmail-uima-commits-archive@uima.apache.org Received: (qmail 61157 invoked by uid 500); 21 Sep 2010 21:06:04 -0000 Mailing-List: contact commits-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@uima.apache.org Delivered-To: mailing list commits@uima.apache.org Received: (qmail 61150 invoked by uid 99); 21 Sep 2010 21:06:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 21:06:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 21:06:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DFAF5238890A; Tue, 21 Sep 2010 21:05:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r999643 - in /uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika: FileSystemCollectionReader.java TIKAWrapper.java Date: Tue, 21 Sep 2010 21:05:43 -0000 To: commits@uima.apache.org From: tommaso@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100921210543.DFAF5238890A@eris.apache.org> Author: tommaso Date: Tue Sep 21 21:05:43 2010 New Revision: 999643 URL: http://svn.apache.org/viewvc?rev=999643&view=rev Log: [UIMA-1878] - backward compatibility reestablished Modified: uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/FileSystemCollectionReader.java uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/TIKAWrapper.java Modified: uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/FileSystemCollectionReader.java URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/FileSystemCollectionReader.java?rev=999643&r1=999642&r2=999643&view=diff ============================================================================== --- uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/FileSystemCollectionReader.java (original) +++ uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/FileSystemCollectionReader.java Tue Sep 21 21:05:43 2010 @@ -96,9 +96,9 @@ public class FileSystemCollectionReader // call Tika wrapper try { - tika.populateCASfromURI(aCAS, file.toURI(), this.mMIME, this.mLanguage); + tika.populateCASfromURL(aCAS, file.toURI().toURL(), this.mMIME, this.mLanguage); } catch (CASException e) { - getLogger().log(Level.WARNING,"Problem converting file : "+file.toURL()+"\t"+e.getMessage()); + getLogger().log(Level.WARNING,"Problem converting file : "+file.toURI().toURL()+"\t"+e.getMessage()); throw new IOException(e); //jcas.setDocumentText(" "); return; } Modified: uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/TIKAWrapper.java URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/TIKAWrapper.java?rev=999643&r1=999642&r2=999643&view=diff ============================================================================== --- uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/TIKAWrapper.java (original) +++ uima/sandbox/trunk/TikaAnnotator/src/main/java/org/apache/uima/tika/TIKAWrapper.java Tue Sep 21 21:05:43 2010 @@ -22,7 +22,7 @@ package org.apache.uima.tika; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; -import java.net.URI; +import java.net.URL; import org.apache.tika.config.TikaConfig; import org.apache.tika.exception.TikaException; @@ -33,7 +33,6 @@ import org.apache.uima.cas.CAS; import org.apache.uima.cas.CASException; import org.apache.uima.jcas.JCas; import org.apache.uima.jcas.cas.FSArray; -import org.apache.uima.util.Level; public class TIKAWrapper { @@ -55,16 +54,16 @@ public class TIKAWrapper { } - public void populateCASfromURI(CAS cas, URI uri, String language) throws CASException{ - populateCASfromURI(cas, uri, null, language); + public void populateCASfromURL(CAS cas, URL uri, String language) throws CASException{ + populateCASfromURL(cas, uri, null, language); } - public void populateCASfromURI(CAS cas, URI uri, String mime, String language) throws CASException{ + public void populateCASfromURL(CAS cas, URL url, String mime, String language) throws CASException{ InputStream originalStream=null; try { originalStream = new BufferedInputStream( - uri.toURL().openStream()); + url.openStream()); } catch (IOException e1) { new CASException(e1); } @@ -126,8 +125,8 @@ public class TIKAWrapper { } FeatureValue fv = new FeatureValue(jcas); - fv.setName("uri"); - fv.setValue(uri.toString()); + fv.setName("url"); + fv.setValue(url.toString()); docAnnotation.setFeatures(i,fv); docAnnotation.addToIndexes();