save_location = save_location.getParentFile();
}
for (int i = 0; i < pm_files.length; i++) {
DMPieceMapperFile pm_info = pm_files[i];
File relative_file = pm_info.getDataFile();
long target_length = pm_info.getLength();
DiskManagerFileInfoImpl file_info =
new DiskManagerFileInfoImpl(
this,
new File( save_location, relative_file.toString()),
i,
pm_info.getTorrentFile(),
DiskManagerFileInfo.ST_LINEAR );
local_files[i] = file_info;
CacheFile cache_file = file_info.getCacheFile();
File data_file = file_info.getFile(true);
if ( !cache_file.exists()){
throw( new Exception( "File '" + data_file + "' doesn't exist" ));
}
if ( cache_file.getLength() != target_length ){
throw( new Exception( "File '" + data_file + "' doesn't exist" ));
}
pm_info.setFileInfo( file_info );
}
ok = true;
return( local_files );