Code Search for Developers
 
 
  

A_CompressedCompositeAdapter.java from Kneobase at Krugle


Show A_CompressedCompositeAdapter.java syntax highlighted

/*
 * Created on 01/11/2004
 *
 */
package com.kneobase.driver.compressed;

import java.io.File;
import java.util.Iterator;

import com.kneobase.I_KneobaseConstants;
import com.kneobase.KneobaseException;
import com.kneobase.driver.content.A_TreeCompositeContentAdapter;
import com.kneobase.driver.content.I_ContentUnit;
import com.kneobase.driver.content.I_TreeContent;

/**
 * @author Ernesto De Santis
 *
 */
public abstract class A_CompressedCompositeAdapter
    extends A_TreeCompositeContentAdapter
    implements I_CompressedCompositeAdapter {

    public A_CompressedCompositeAdapter(I_ContentUnit cu) {
        super(cu);
    }

    public Iterator getChildrenIterator() throws KneobaseException {
        return new CompressedIterator(this);
    }

    public String getAbsolutePath() {
        String parentPath;
        if (getParent() != null) {
            I_TreeContent parent = (I_TreeContent) getParent();
            parentPath = parent.getAbsolutePath();
        } else {
            parentPath = ((I_TreeContent) getContentSource()).getAbsolutePath();
        }
        return parentPath + separatorChar() + getName();
    }

    public char separatorChar() {
        return DEFAULT_SEPARATOR_CHAR;
    }

    /**
     * return a unique identifier of the content.
     * 
     */
    public String getUuid() {
        return getContentSource().getName() + I_KneobaseConstants.UUID_SEPARATOR + getAbsolutePath();
    }
    
    public String getType(){
    	return getContentUnit().getType();
    }
    
    public long lastModified() {
        File file = (File) getParent().getContentObject();
        return file.lastModified();
    }
    
}




See more files for this project here

Kneobase

Kneobase is an enterprise search engine, based upon the Lucene search engine and the Spring framework. It allows to perform full-text search across many different content sources. It is highly adaptable out-of-the-box and has a pluggable architecture.

Project homepage: http://sourceforge.net/projects/kneobase
Programming language(s): Java,XML
License: other

  A_CompressedCompositeAdapter.java
  A_EntryAdapter.java
  CompressedIterator.java
  EntryInputStream.java
  I_CompressedCompositeAdapter.java
  I_EntryAdapter.java