ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
League\Flysystem\File Class Reference
+ Inheritance diagram for League\Flysystem\File:
+ Collaboration diagram for League\Flysystem\File:

Public Member Functions

 exists ()
 Check whether the file exists. More...
 
 read ()
 Read the file. More...
 
 readStream ()
 Read the file as a stream. More...
 
 write ($content)
 Write the new file. More...
 
 writeStream ($resource)
 Write the new file using a stream. More...
 
 update ($content)
 Update the file contents. More...
 
 updateStream ($resource)
 Update the file contents with a stream. More...
 
 put ($content)
 Create the file or update if exists. More...
 
 putStream ($resource)
 Create the file or update if exists using a stream. More...
 
 rename ($newpath)
 Rename the file. More...
 
 copy ($newpath)
 Copy the file. More...
 
 getTimestamp ()
 Get the file's timestamp. More...
 
 getMimetype ()
 Get the file's mimetype. More...
 
 getVisibility ()
 Get the file's visibility. More...
 
 getMetadata ()
 Get the file's metadata. More...
 
 getSize ()
 Get the file size. More...
 
 delete ()
 Delete the file. More...
 
- Public Member Functions inherited from League\Flysystem\Handler
 __construct (FilesystemInterface $filesystem=null, $path=null)
 Constructor. More...
 
 isDir ()
 Check whether the entree is a directory. More...
 
 isFile ()
 Check whether the entree is a file. More...
 
 getType ()
 Retrieve the entree type (file|dir). More...
 
 setFilesystem (FilesystemInterface $filesystem)
 Set the Filesystem object. More...
 
 getFilesystem ()
 Retrieve the Filesystem object. More...
 
 setPath ($path)
 Set the entree path. More...
 
 getPath ()
 Retrieve the entree path. More...
 
 __call ($method, array $arguments)
 Plugins pass-through. More...
 

Additional Inherited Members

- Protected Attributes inherited from League\Flysystem\Handler
 $path
 
 $filesystem
 

Detailed Description

Definition at line 5 of file File.php.

Member Function Documentation

◆ copy()

League\Flysystem\File::copy (   $newpath)

Copy the file.

Parameters
string$newpath
Returns
File|false new file or false

Definition at line 134 of file File.php.

135 {
136 if ($this->filesystem->copy($this->path, $newpath)) {
137 return new File($this->filesystem, $newpath);
138 }
139
140 return false;
141 }

◆ delete()

League\Flysystem\File::delete ( )

Delete the file.

Returns
bool success boolean

Definition at line 198 of file File.php.

199 {
200 return $this->filesystem->delete($this->path);
201 }

◆ exists()

League\Flysystem\File::exists ( )

Check whether the file exists.

Returns
bool

Definition at line 12 of file File.php.

13 {
14 return $this->filesystem->has($this->path);
15 }

◆ getMetadata()

League\Flysystem\File::getMetadata ( )

Get the file's metadata.

Returns
array

Definition at line 178 of file File.php.

179 {
180 return $this->filesystem->getMetadata($this->path);
181 }

◆ getMimetype()

League\Flysystem\File::getMimetype ( )

Get the file's mimetype.

Returns
string mimetime

Definition at line 158 of file File.php.

159 {
160 return $this->filesystem->getMimetype($this->path);
161 }

◆ getSize()

League\Flysystem\File::getSize ( )

Get the file size.

Returns
int file size

Definition at line 188 of file File.php.

189 {
190 return $this->filesystem->getSize($this->path);
191 }

◆ getTimestamp()

League\Flysystem\File::getTimestamp ( )

Get the file's timestamp.

Returns
int unix timestamp

Definition at line 148 of file File.php.

149 {
150 return $this->filesystem->getTimestamp($this->path);
151 }

◆ getVisibility()

League\Flysystem\File::getVisibility ( )

Get the file's visibility.

Returns
string visibility

Definition at line 168 of file File.php.

169 {
170 return $this->filesystem->getVisibility($this->path);
171 }

◆ put()

League\Flysystem\File::put (   $content)

Create the file or update if exists.

Parameters
string$content
Returns
bool success boolean

Definition at line 92 of file File.php.

93 {
94 return $this->filesystem->put($this->path, $content);
95 }

◆ putStream()

League\Flysystem\File::putStream (   $resource)

Create the file or update if exists using a stream.

Parameters
resource$resource
Returns
bool success boolean

Definition at line 104 of file File.php.

105 {
106 return $this->filesystem->putStream($this->path, $resource);
107 }

◆ read()

League\Flysystem\File::read ( )

Read the file.

Returns
string file contents

Definition at line 22 of file File.php.

23 {
24 return $this->filesystem->read($this->path);
25 }

◆ readStream()

League\Flysystem\File::readStream ( )

Read the file as a stream.

Returns
resource file stream

Definition at line 32 of file File.php.

33 {
34 return $this->filesystem->readStream($this->path);
35 }

◆ rename()

League\Flysystem\File::rename (   $newpath)

Rename the file.

Parameters
string$newpath
Returns
bool success boolean

Definition at line 116 of file File.php.

117 {
118 if ($this->filesystem->rename($this->path, $newpath)) {
119 $this->path = $newpath;
120
121 return true;
122 }
123
124 return false;
125 }

◆ update()

League\Flysystem\File::update (   $content)

Update the file contents.

Parameters
string$content
Returns
bool success boolean

Definition at line 68 of file File.php.

69 {
70 return $this->filesystem->update($this->path, $content);
71 }

◆ updateStream()

League\Flysystem\File::updateStream (   $resource)

Update the file contents with a stream.

Parameters
resource$resource
Returns
bool success boolean

Definition at line 80 of file File.php.

81 {
82 return $this->filesystem->updateStream($this->path, $resource);
83 }

◆ write()

League\Flysystem\File::write (   $content)

Write the new file.

Parameters
string$content
Returns
bool success boolean

Definition at line 44 of file File.php.

45 {
46 return $this->filesystem->write($this->path, $content);
47 }

◆ writeStream()

League\Flysystem\File::writeStream (   $resource)

Write the new file using a stream.

Parameters
resource$resource
Returns
bool success boolean

Definition at line 56 of file File.php.

57 {
58 return $this->filesystem->writeStream($this->path, $resource);
59 }

The documentation for this class was generated from the following file: