original_string: public function name($value = false, $overwrite = false)
      {
          if ($value === false) {
              return $this->adapter->basename($this->path);
          }
  
          if (! is_string($value) || strlen($value) == 0) {
              throw new FilesystemException('Invalid name given to name() method');
          }
  
          $newPath = substr($this->path, 0, strrpos($this->path, DIRECTORY_SEPARATOR) + 1);
          $newPath .= $value;
  
          return $this->path($newPath, $overwrite);
      }
code: public function name($value = false, $overwrite = false)
      {
          if ($value === false) {
              return $this->adapter->basename($this->path);
          }
  
          if (! is_string($value) || strlen($value) == 0) {
              throw new FilesystemException('Invalid name given to name() method');
          }
  
          $newPath = substr($this->path, 0, strrpos($this->path, DIRECTORY_SEPARATOR) + 1);
          $newPath .= $value;
  
          return $this->path($newPath, $overwrite);
      }
code_tokens: public function name ( $ value = false , $ overwrite = false ) { if ( $ value === false ) { return $ this -> adapter -> basename ( $ this -> path ) ; } if ( ! is_string ( $ value ) || strlen ( $ value ) == 0 ) { throw new FilesystemException ( 'Invalid name given to name() method' ) ; } $ newPath = substr ( $ this -> path , 0 , strrpos ( $ this -> path , DIRECTORY_SEPARATOR ) + 1 ) ; $ newPath .= $ value ; return $ this -> path ( $ newPath , $ overwrite ) ; }
docstring: Gets or sets the name of the file.
  
  @param  string $value
  @param  boolean $overwrite
  @return string|Tarsana\Filesystem\AbstractFile
  
  @throws Tarsana\Filesystem\Exceptions\FilesystemException if invalid name given or could not rename the file.
docstring_tokens: Gets or sets the name of the file .