ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\LegalDocuments\Consumer\ContainerURIConsumer Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\Consumer\ContainerURIConsumer:
+ Collaboration diagram for ILIAS\LegalDocuments\Consumer\ContainerURIConsumer:

Public Member Functions

 __construct (private SrcBuilder $src_builder, StorableContainerResource $resource, private StreamAccess $stream_access, private string $start_file, private float $valid_for_at_least_minutes=60.0)
 DownloadConsumer constructor. More...
 
 getURI ()
 

Protected Attributes

int $revision_number = null
 

Private Attributes

Archives $archives
 
StorableResource $resource
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Consumer\ContainerURIConsumer::__construct ( private SrcBuilder  $src_builder,
StorableContainerResource  $resource,
private StreamAccess  $stream_access,
private string  $start_file,
private float  $valid_for_at_least_minutes = 60.0 
)

DownloadConsumer constructor.

Definition at line 42 of file ContainerURIConsumer.php.

References $DIC, and ILIAS\LegalDocuments\Consumer\ContainerURIConsumer\$resource.

48  {
49  global $DIC;
50  $this->resource = $resource;
51  $this->archives = $DIC->archives();
52  }
global $DIC
Definition: shib_login.php:25

Member Function Documentation

◆ getURI()

ILIAS\LegalDocuments\Consumer\ContainerURIConsumer::getURI ( )

Definition at line 54 of file ContainerURIConsumer.php.

References $filename, and ILIAS\FileDelivery\Delivery\StreamDelivery\SUBREQUEST_SEPARATOR.

54  : ?URI
55  {
56  $filename = basename($this->start_file);
57  if ($filename === '') {
58  $filename = null;
59  }
60 
61  $startfile = urlencode($this->start_file); // e.g. for files with " " (spaces)
62  $startfile = str_replace(urlencode("/"), "/", $startfile); // we must keep directory sepparators
63 
64  $uri_string = $this->src_builder->getRevisionURL(
65  $this->stream_access->populateRevision($this->getRevision()),
66  true,
67  $this->valid_for_at_least_minutes,
68  $filename
69  ) . StreamDelivery::SUBREQUEST_SEPARATOR . $startfile;
70 
71  try {
72  return new URI($uri_string);
73  } catch (\Throwable) {
74  return null;
75  }
76  }
$filename
Definition: buildRTE.php:78

Field Documentation

◆ $archives

Archives ILIAS\LegalDocuments\Consumer\ContainerURIConsumer::$archives
private

Definition at line 35 of file ContainerURIConsumer.php.

◆ $resource

StorableResource ILIAS\LegalDocuments\Consumer\ContainerURIConsumer::$resource
private

◆ $revision_number

int ILIAS\LegalDocuments\Consumer\ContainerURIConsumer::$revision_number = null
protected

Definition at line 36 of file ContainerURIConsumer.php.


The documentation for this class was generated from the following file: