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