package com.dotj.test;
import java.io.File;
import java.util.Date;
/**
* JavaBean to encapsulate a File object.
*/
public class FileBean {
private File _file = null;
/**
* Default constructor: based on a valid File object.
*/
public FileBean(File theFile) {
_file = theFile;
}
/**
* Return the file size as a long.
*/
public long getLength() {
return _file.length();
}
/**
* Return the last modified field as a java.util.Date
*/
public Date getLastModified() {
long lDate = _file.lastModified();
Date temp = new Date();
temp.setTime(lDate);
return temp;
}
//************** OTHER FILE FIELDS ***************** //
public String getAbsolutePath() { return _file.getAbsolutePath(); }
public String getName() { return _file.getName(); }
public String getParent() { return _file.getParent(); }
public String getPath() { return _file.getPath(); }
}