ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
Request.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\FileDelivery\Token;
22 
26 
30 final class Request
31 {
32  public function __construct(
33  private FileStream $stream,
34  private Disposition $disposition,
35  private string $file_name,
36  private int $valid_for_at_least_hours,
37  ) {
38  }
39 
40  public static function fromStreamAttached(
41  FileStream $stream,
42  string $file_name,
43  int $valid_for_at_least_hours,
44  ): self {
45  return new self(
46  $stream,
47  Disposition::ATTACHMENT,
48  $file_name,
49  $valid_for_at_least_hours
50  );
51  }
52 
53  public static function fromStreamInline(
54  FileStream $stream,
55  string $file_name,
56  int $valid_for_at_least_hours,
57  ): self {
58  return new self(
59  $stream,
60  Disposition::INLINE,
61  $file_name,
62  $valid_for_at_least_hours
63  );
64  }
65 }
static fromStreamAttached(FileStream $stream, string $file_name, int $valid_for_at_least_hours,)
Definition: Request.php:40
static fromStreamInline(FileStream $stream, string $file_name, int $valid_for_at_least_hours,)
Definition: Request.php:53
__construct(private FileStream $stream, private Disposition $disposition, private string $file_name, private int $valid_for_at_least_hours,)
Definition: Request.php:32
The base interface for all filesystem streams.
Definition: FileStream.php:31