public function init($type, $file)
{
$filename = $this->filterFileName($file->getFileName());
$posTypePath = strpos($file->getPathname(), DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR) + strlen(DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR);
$this->hash = $this->makeHash($type . $filename);
$this->title = $this->filterTitle($filename);
$this->filename = substr($file->getPathname(), $posTypePath);
$this->file = $file;
$this->type = $type;
$this->state = self::STATE_READY;
// Not used yet.
}