public SharedFileListing(LocalFile file, bool includePieces)
{
if (file.InfoHash == null) {
throw new ArgumentException("File must have InfoHash");
}
this.name = file.Name;
this.fullPath = "/" + String.Join("/", file.FullPath.Split('/').Slice(2));
this.size = file.Size;
this.infoHash = file.InfoHash;
this.sha1 = file.SHA1;
this.type = FileType.Other; // FIXME: Use real file type.
this.pieceLength = file.PieceLength;
if (includePieces)
this.pieces = file.Pieces;
}