setSize() public method

public setSize ( integer $size )
$size integer size of the file
Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     $file = new File($key, $filesystem);
     $stat = $this->sftp->stat($this->computePath($key));
     if (isset($stat['size'])) {
         $file->setSize($stat['size']);
     }
     return $file;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     $file = new File($key, $filesystem);
     if (!array_key_exists($key, $this->fileData)) {
         $directory = dirname($key) == '.' ? '' : dirname($key);
         $this->listDirectory($directory);
     }
     $fileData = $this->fileData[$key];
     $file->setName($fileData['name']);
     $file->setSize($fileData['size']);
     return $file;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     $this->ensureDirectoryExists($this->directory, $this->create);
     $file = new File($key, $filesystem);
     if (!array_key_exists($key, $this->fileData)) {
         $dirname = \Gaufrette\Util\Path::dirname($key);
         $directory = $dirname == '.' ? '' : $dirname;
         $this->listDirectory($directory);
     }
     if (isset($this->fileData[$key])) {
         $fileData = $this->fileData[$key];
         $file->setName($fileData['name']);
         $file->setSize($fileData['size']);
     }
     return $file;
 }
Ejemplo n.º 4
0
 /**
  * {@inheritDoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     if (!$this->exists($key)) {
         throw new \RuntimeException(sprintf('The \'%s\' file does not exist.', $key));
     }
     $file = new File($key, $filesystem);
     if (!array_key_exists($key, $this->fileData)) {
         $directory = dirname($key) == '.' ? '' : dirname($key);
         $this->listDirectory($directory);
     }
     $fileData = $this->fileData[$key];
     $created = new \DateTime();
     $created->setTimestamp($fileData['time']);
     $file->setName($fileData['name']);
     $file->setCreated($created);
     $file->setSize($fileData['size']);
     return $file;
 }