Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
f45df609
Unverified
Commit
f45df609
authored
6 years ago
by
Morris Jobke
Browse files
Options
Downloads
Patches
Plain Diff
Add since labels
Signed-off-by:
Morris Jobke
<
hey@morrisjobke.de
>
parent
2a8118e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/public/Files/SimpleFS/InMemoryFile.php
+13
-0
13 additions, 0 deletions
lib/public/Files/SimpleFS/InMemoryFile.php
with
13 additions
and
0 deletions
lib/public/Files/SimpleFS/InMemoryFile.php
+
13
−
0
View file @
f45df609
...
...
@@ -29,6 +29,7 @@ use OCP\Files\NotPermittedException;
* This class represents a file that is only hold in memory.
*
* @package OC\Files\SimpleFS
* @since 16.0.0
*/
class
InMemoryFile
implements
ISimpleFile
{
/**
...
...
@@ -50,6 +51,7 @@ class InMemoryFile implements ISimpleFile {
*
* @param string $name The file name
* @param string $contents The file contents
* @since 16.0.0
*/
public
function
__construct
(
string
$name
,
string
$contents
)
{
$this
->
name
=
$name
;
...
...
@@ -58,6 +60,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
getName
()
{
return
$this
->
name
;
...
...
@@ -65,6 +68,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
getSize
()
{
return
strlen
(
$this
->
contents
);
...
...
@@ -72,6 +76,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
getETag
()
{
return
''
;
...
...
@@ -79,6 +84,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
getMTime
()
{
return
time
();
...
...
@@ -86,6 +92,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
getContent
()
{
return
$this
->
contents
;
...
...
@@ -93,6 +100,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
putContent
(
$data
)
{
$this
->
contents
=
$data
;
...
...
@@ -100,6 +108,8 @@ class InMemoryFile implements ISimpleFile {
/**
* In memory files can't be deleted.
*
* @since 16.0.0
*/
public
function
delete
()
{
// unimplemented for in memory files
...
...
@@ -107,6 +117,7 @@ class InMemoryFile implements ISimpleFile {
/**
* @inheritdoc
* @since 16.0.0
*/
public
function
getMimeType
()
{
$fileInfo
=
new
\finfo
(
FILEINFO_MIME_TYPE
);
...
...
@@ -117,6 +128,7 @@ class InMemoryFile implements ISimpleFile {
* Stream reading is unsupported for in memory files.
*
* @throws NotPermittedException
* @since 16.0.0
*/
public
function
read
()
{
throw
new
NotPermittedException
(
...
...
@@ -128,6 +140,7 @@ class InMemoryFile implements ISimpleFile {
* Stream writing isn't available for in memory files.
*
* @throws NotPermittedException
* @since 16.0.0
*/
public
function
write
()
{
throw
new
NotPermittedException
(
...
...
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