@ -43,8 +43,8 @@ import net.yacy.document.TextParser;
import net.yacy.document.VocabularyScraper ;
import net.yacy.kelondro.util.FileUtils ;
import org.apache. tools.tar.Tar Entry;
import org.apache. tools.tar.Tar InputStream;
import org.apache. commons.compress.archivers.tar.TarArchive Entry;
import org.apache. commons.compress.archivers.tar.TarArchive InputStream;
// this is a new implementation of this parser idiom using multiple documents as result set
@ -80,15 +80,14 @@ public class tarParser extends AbstractParser implements Parser {
throw new Parser . Failure ( "tar parser: " + e . getMessage ( ) , location ) ;
}
}
Tar Entry entry ;
final Tar InputStream tis = new Tar InputStream( source ) ;
Tar Archive Entry entry ;
final Tar Archive InputStream tis = new Tar Archive InputStream( source ) ;
File tmp = null ;
// loop through the elements in the tar file and parse every single file inside
while ( true ) {
try {
if ( tis . available ( ) < = 0 ) break ;
entry = tis . getNextEntry ( ) ;
entry = tis . getNextTarEntry ( ) ;
if ( entry = = null ) break ;
if ( entry . isDirectory ( ) | | entry . getSize ( ) < = 0 ) continue ;
final String name = entry . getName ( ) ;
@ -110,6 +109,7 @@ public class tarParser extends AbstractParser implements Parser {
break ;
}
}
if ( docacc . isEmpty ( ) ) return null ;
return docacc . toArray ( new Document [ docacc . size ( ) ] ) ;
}