78 Option $user_selected_option,
82 $download_name =
$input[0];
85 $this->
logger->debug(
"Interaction -> input[0] download name MUST BE FULL PATH=> " . $download_name->getValue());
86 $this->
logger->debug(
"Interaction -> input[1] zip name MUST BE THE NAME WITHOUT EXTENSION. => " . $zip_name->getValue());
88 if ($user_selected_option->
getValue() != self::OPTION_DOWNLOAD) {
89 $this->
logger->info(
'Download canceled');
91 $filesystem =
$DIC->filesystem()->temp();
93 $path = LegacyPathHelper::createRelativePath($download_name->getValue());
94 }
catch (InvalidArgumentException
$e) {
99 if (!is_null(
$path) && $filesystem->has(
$path)) {
100 $this->
logger->debug(
"Delete dir: " . dirname(
$path));
101 $filesystem->deleteDir(dirname(
$path));
103 }
catch (Exception
$e) {
106 return $download_name;
109 $this->
logger->info(
"Delivering File.");
112 $zip_name = $zip_name->getValue();
114 $ending = substr($zip_name, -4);
115 if ($ending !=
".zip") {
117 $this->
logger->info(
"Add .zip extension");
122 $this->
logger->debug(
"Deliver: " . $download_name->getValue());
123 $this->
logger->debug(
"As: " . $zip_name);
126 return $download_name;
The legacy path helper provides convenient functions for the integration of the filesystem service wi...
getRemoveOption()
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed...
interaction(array $input, Option $user_selected_option, Bucket $bucket)
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
Component logger with individual log levels by component id.