diff options
author | adrianocrestani <adrianocrestani@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-10 01:40:02 +0000 |
---|---|---|
committer | adrianocrestani <adrianocrestani@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-10 01:40:02 +0000 |
commit | 8e7db232ee169c8d8513c8e8a84921d905e4af2d (patch) | |
tree | 0cc43203723c019a13f23a1b46b466639ed37da0 /branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java | |
parent | 1dff5319f17ee5bec9588675d43a84e836627a5d (diff) |
applying tuscany_2552_domain_search_phillipe_ramalho_08_08_2009.patch and tuscany_2552_domain_manager_phillipe_ramalho_08_08_2009.patch submitted to TUSCANY-2552
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@802637 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java b/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java index 3f3112dd60..b36d2c1d79 100644 --- a/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java +++ b/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java @@ -2,7 +2,6 @@ package org.apache.tuscany.sca.domain.search.impl; import java.io.File; import java.io.IOException; -import java.util.zip.ZipException; import java.util.zip.ZipFile; import org.apache.lucene.document.Field; @@ -11,8 +10,6 @@ import org.apache.tuscany.sca.domain.search.DocumentProcessor; public class ZipDocumentProcessor implements DocumentProcessor { - final public static char ARCHIVE_SEPARATOR = '\u0004'; - public Object getDocumentKey(Object object) { if (object instanceof File) { @@ -39,18 +36,18 @@ public class ZipDocumentProcessor implements DocumentProcessor { SystemFileContent file = (SystemFileContent) object; try { - ZipFile zip = new ZipFile(file); + ZipFile zip = new ZipFile(file.getFile()); if (document == null) { document = documents.get(file.getPath()); } parent += DomainPathAnalyzer.PATH_SEPARATOR - + SearchFields.FILE_FIELD - + DomainPathAnalyzer.TYPE_SEPARATOR + file.getPath() + ARCHIVE_SEPARATOR + + SearchFields.ARTIFACT_FIELD + + DomainPathAnalyzer.TYPE_SEPARATOR + "jar:file:" + file.getPath() + DomainPathAnalyzer.ARCHIVE_SEPARATOR + '/' + file.getName() + DomainPathAnalyzer.URI_SEPARATOR + file.getName(); - document.add(new Field(SearchFields.FILE_FIELD, file.getName(), Field.Store.YES, + document.add(new Field(SearchFields.ARTIFACT_FIELD, file.getName(), Field.Store.YES, Field.Index.ANALYZED)); ZipFileContent[] zipFiles = ZipFileContent.createZipFileContent(zip); |