summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java')
-rw-r--r--branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/ZipDocumentProcessor.java11
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);