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