Skip to content

Commit

Permalink
Merge pull request #27 from chrisnharvey/can-overwrite
Browse files Browse the repository at this point in the history
Make the adapter implement CanOverwriteFiles
  • Loading branch information
mzur authored Feb 8, 2022
2 parents 99ef0d7 + 98caeb6 commit 7845f3b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/SwiftAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

use GuzzleHttp\Psr7\Stream;
use GuzzleHttp\Psr7\StreamWrapper;
use League\Flysystem\Util;
use League\Flysystem\Config;
use League\Flysystem\Adapter\AbstractAdapter;
use League\Flysystem\Adapter\CanOverwriteFiles;
use League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait;
use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait;
use League\Flysystem\Config;
use League\Flysystem\Util;
use OpenStack\Common\Error\BadResponseError;
use OpenStack\ObjectStore\v1\Models\Container;
use OpenStack\ObjectStore\v1\Models\StorageObject;
use League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait;
use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait;

class SwiftAdapter extends AbstractAdapter
class SwiftAdapter extends AbstractAdapter implements CanOverwriteFiles
{
use StreamedCopyTrait;
use NotSupportingVisibilityTrait;
Expand Down Expand Up @@ -87,7 +88,7 @@ public function update($path, $contents, Config $config)
*/
public function updateStream($path, $resource, Config $config)
{
return $this->write($path, new Stream($resource), $config, Util::getStreamSize($resource));
return $this->writeStream($path, $resource, $config);
}

/**
Expand Down

0 comments on commit 7845f3b

Please sign in to comment.