Code Search for Developers
 
 
  

FileAdapter.java from Kneobase at Krugle


Show FileAdapter.java syntax highlighted

/*
 * Created on 18/05/2004
 *
 */
package com.kneobase.driver.fs;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import com.kneobase.driver.content.A_TreeContentUnit;

/**
 * @author Ernesto De Santis
 *
 */
public class FileAdapter extends A_TreeContentUnit {
    
    public FileAdapter(File aFile, FolderAdapter parent){
        super(aFile, parent);
    }

    public File getFile(){
        return (File) getContentObject();
    }
    
    public InputStream getBodyInputStream() throws FileNotFoundException {
        return new FileInputStream(getFile());
    }
    
    public String getName() {
        return getFile().getName();
    }

    public String getAbsolutePath() {
        return getFile().getAbsolutePath();
    }

    public char separatorChar() {
        return File.separatorChar;
    }

    public long lastModified() {
        return getFile().lastModified();
    }
    
    public long getSize() {
        return getFile().length();
    }

}




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

  condition/
    FSCategoryCondition.java
    FSRegularExpressionCondition.java
  documentbuilder/
    A_FSFieldBuilder.java
  FSContentSource.java
  FSPathCriteria.java
  FileAdapter.java
  FolderAdapter.java