package FolderSplit;

import java.io.File;
import java.util.Date;

public class FileInfo {
	final File file;
    final String name;
    final long size;
    final Date modified;
    
    public FileInfo(File file) {
    	this.file = file;
        size = file.length();
        modified = new Date(file.lastModified());
        name = file.getName().substring(file.getName().lastIndexOf(File.separator) + 1);
    }
    
    public String getExtension() {
        return name.contains(".") ? name.substring(name.lastIndexOf(".") + 1) : "";
    }

    public String getFilename() {
        return name.contains(".") ? name.substring(0, name.lastIndexOf(".")) : name;
    }

}
