diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-20 16:12:46 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-20 16:12:46 +0200 |
commit | 7e447f4f42de8dc0cf9a1f92c61a71dfda8f8dcd (patch) | |
tree | 3ce88392f3a2b54e1d7c8e4c2be88b7764378f26 /lib/private/appframework/http | |
parent | 1abd9c1305745fe4e66b8b4d0a45f56526dad216 (diff) | |
download | nextcloud-server-7e447f4f42de8dc0cf9a1f92c61a71dfda8f8dcd.tar.gz nextcloud-server-7e447f4f42de8dc0cf9a1f92c61a71dfda8f8dcd.zip |
make download and redirectresponse public
Diffstat (limited to 'lib/private/appframework/http')
-rw-r--r-- | lib/private/appframework/http/downloadresponse.php | 50 | ||||
-rw-r--r-- | lib/private/appframework/http/redirectresponse.php | 57 |
2 files changed, 0 insertions, 107 deletions
diff --git a/lib/private/appframework/http/downloadresponse.php b/lib/private/appframework/http/downloadresponse.php deleted file mode 100644 index 67b9542dba6..00000000000 --- a/lib/private/appframework/http/downloadresponse.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * ownCloud - App Framework - * - * @author Bernhard Posselt - * @copyright 2012 Bernhard Posselt nukeawhale@gmail.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - - -namespace OC\AppFramework\Http; - - -/** - * Prompts the user to download the a file - */ -class DownloadResponse extends \OCP\AppFramework\Http\Response { - - private $filename; - private $contentType; - - /** - * Creates a response that prompts the user to download the file - * @param string $filename the name that the downloaded file should have - * @param string $contentType the mimetype that the downloaded file should have - */ - public function __construct($filename, $contentType) { - $this->filename = $filename; - $this->contentType = $contentType; - - $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); - $this->addHeader('Content-Type', $contentType); - } - - -} diff --git a/lib/private/appframework/http/redirectresponse.php b/lib/private/appframework/http/redirectresponse.php deleted file mode 100644 index 05353349065..00000000000 --- a/lib/private/appframework/http/redirectresponse.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * ownCloud - App Framework - * - * @author Bernhard Posselt - * @copyright 2012 Bernhard Posselt nukeawhale@gmail.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - - -namespace OC\AppFramework\Http; - -use OCP\AppFramework\Http\Response; -use OCP\AppFramework\Http; - - -/** - * Redirects to a different URL - */ -class RedirectResponse extends Response { - - private $redirectURL; - - /** - * Creates a response that redirects to a url - * @param string $redirectURL the url to redirect to - */ - public function __construct($redirectURL) { - $this->redirectURL = $redirectURL; - $this->setStatus(Http::STATUS_TEMPORARY_REDIRECT); - $this->addHeader('Location', $redirectURL); - } - - - /** - * @return string the url to redirect - */ - public function getRedirectURL() { - return $this->redirectURL; - } - - -} |