$downloadsDir =
$this->container->
getParameter('shopware.app.downloadsDir'
);
if (!\
is_string($downloadsDir)) { throw new RuntimeException('Parameter shopware.app.downloadsDir has to be a string'
);
} $destination =
rtrim($downloadsDir, '/'
) . DIRECTORY_SEPARATOR .
$metaStruct->
getFileName();
if ($offset === 0
) { unlink($destination);
} $request =
new RangeDownloadRequest( $metaStruct->
getUri(),
$offset,
(int) $metaStruct->
getSize(),
$metaStruct->
getSha1(),
$destination );
try { $result =
$this->
get('shopware_plugininstaller.plugin_download_service'
)->
downloadRange($request);
} catch (Exception
$e) { $this->
handleException($e);