<commit_before><?php

namespace CedricZiel\FlysystemGcs;

use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Storage\Acl;
use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\StorageObject;
use Google\Cloud\Storage\StorageClient;
use League\Flysystem\Adapter\AbstractAdapter;
use League\Flysystem\Adapter\Polyfill\StreamedReadingTrait;
use League\Flysystem\AdapterInterface;
use League\Flysystem\Config;

/**
 * Flysystem Adapter for Google Cloud Storage.
 * Permissions:
 * Flysystem mostly uses 2 different types of visibility: public and private. This adapter maps those
 * to either grant project-private access or public access. The default is `projectPrivate`
 * For using a more appropriate ACL for a specific use-case, the
 *
 * @see AdapterInterface
 */
class GoogleCloudStorageAdapter extends AbstractAdapter
{
    use StreamedReadingTrait;

    /**
     * ACL that grants access to everyone on the project
     */
    const GCS_VISIBILITY_PROJECT_PRIVATE = 'projectPrivate';

    /**
     * ACL that grants public read access to everyone
     */
    const GCS_VISIBILITY_PUBLIC_READ = 'publicRead';

    /**
     * Public URL prefix
     */
    const GCS_BASE_URL = 'https://storage.googleapis.com';

    /**
     * @var Bucket
     */
    protected $bucket;

    /**
     * @var string
     */
    protected $baseUrl;<commit_msg>Indicate that GCS adapter can overwrite file.<commit_after><?php

namespace CedricZiel\FlysystemGcs;

use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Storage\Acl;
use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\StorageObject;
use Google\Cloud\Storage\StorageClient;
use League\Flysystem\Adapter\AbstractAdapter;
use League\Flysystem\Adapter\CanOverwriteFiles;
use League\Flysystem\Adapter\Polyfill\StreamedReadingTrait;
use League\Flysystem\AdapterInterface;
use League\Flysystem\Config;

/**
 * Flysystem Adapter for Google Cloud Storage.
 * Permissions:
 * Flysystem mostly uses 2 different types of visibility: public and private. This adapter maps those
 * to either grant project-private access or public access. The default is `projectPrivate`
 * For using a more appropriate ACL for a specific use-case, the
 *
 * @see AdapterInterface
 */
class GoogleCloudStorageAdapter extends AbstractAdapter implements CanOverwriteFiles
{
    use StreamedReadingTrait;

    /**
     * ACL that grants access to everyone on the project
     */
    const GCS_VISIBILITY_PROJECT_PRIVATE = 'projectPrivate';

    /**
     * ACL that grants public read access to everyone
     */
    const GCS_VISIBILITY_PUBLIC_READ = 'publicRead';

    /**
     * Public URL prefix
     */
    const GCS_BASE_URL = 'https://storage.googleapis.com';

    /**
     * @var Bucket
     */
    protected $bucket;

    /**
     * @var string
     */
    protected $baseUrl;
{'fraction_non_alphanumeric': 0.0871252204585538, 'fraction_numerical': 0.0007054673721340388, 'mean_word_length': 3.6568144499178983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6625747', 'n_tokens_mistral': 822, 'n_tokens_neox': 780, 'n_words': 231}