Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
81243b0f
Commit
81243b0f
authored
10 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
adding getDirectDownload() to Wrapper
parent
5b00bc1d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/connector/sabre/filesplugin.php
+2
-2
2 additions, 2 deletions
lib/private/connector/sabre/filesplugin.php
lib/private/files/storage/wrapper/wrapper.php
+12
-0
12 additions, 0 deletions
lib/private/files/storage/wrapper/wrapper.php
with
14 additions
and
2 deletions
lib/private/connector/sabre/filesplugin.php
+
2
−
2
View file @
81243b0f
...
...
@@ -39,7 +39,7 @@ class OC_Connector_Sabre_FilesPlugin extends \Sabre\DAV\ServerPlugin
$server
->
protectedProperties
[]
=
'{'
.
self
::
NS_OWNCLOUD
.
'}id'
;
$server
->
protectedProperties
[]
=
'{'
.
self
::
NS_OWNCLOUD
.
'}permissions'
;
$server
->
protectedProperties
[]
=
'{'
.
self
::
NS_OWNCLOUD
.
'}size'
;
$server
->
protectedProperties
[]
=
'{'
.
self
::
NS_OWNCLOUD
.
'}d
DU
'
;
$server
->
protectedProperties
[]
=
'{'
.
self
::
NS_OWNCLOUD
.
'}d
ownloadURL
'
;
$this
->
server
=
$server
;
$this
->
server
->
subscribeEvent
(
'beforeGetProperties'
,
array
(
$this
,
'beforeGetProperties'
));
...
...
@@ -85,7 +85,7 @@ class OC_Connector_Sabre_FilesPlugin extends \Sabre\DAV\ServerPlugin
/** @var $node OC_Connector_Sabre_File */
$directDownloadUrl
=
$node
->
getDirectDownload
();
if
(
isset
(
$directDownloadUrl
[
'url'
]))
{
$directDownloadUrlPropertyName
=
'{'
.
self
::
NS_OWNCLOUD
.
'}d
DU
'
;
$directDownloadUrlPropertyName
=
'{'
.
self
::
NS_OWNCLOUD
.
'}d
ownloadURL
'
;
$returnedProperties
[
200
][
$directDownloadUrlPropertyName
]
=
$directDownloadUrl
[
'url'
];
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/private/files/storage/wrapper/wrapper.php
+
12
−
0
View file @
81243b0f
...
...
@@ -465,4 +465,16 @@ class Wrapper implements \OC\Files\Storage\Storage {
public
function
__call
(
$method
,
$args
)
{
return
call_user_func_array
(
array
(
$this
->
storage
,
$method
),
$args
);
}
/**
* A custom storage implementation can return an url for direct download of a give file.
*
* For now the returned array can hold the parameter url - in future more attributes might follow.
*
* @param string $path
* @return array
*/
public
function
getDirectDownload
(
$path
)
{
return
$this
->
storage
->
getDirectDownload
(
$path
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment