Method setFileRaw

@access public

@param  string $key
@param  string $contentType
@param  string $content
@param  string $fileName

@return self
189011
public function setFileRaw( string$key, string$contentType, string$content, string$fileName=null ):self
	{
		$this->files[$key]= [
			'fileName'=> $fileName??md5($content),
			'contentType'=> $contentType,
			'content'=> $content,
		];

		return $this;
	}
1121568
public function setContentType($contentType, $charset = null)
    {
        if ($charset === null) {
            $this->setHeader('Content-Type', $contentType);
        } else {
            $this->setHeader('Content-Type', $contentType . '; charset=' . $charset);
        }

        return $this;
    }
55990
public function write($key, $content)
    {
        $path = $this->computePath($key);
        $this->ensureDirectoryExists(\Gaufrette\Util\Path::dirname($path), true);

        return file_put_contents($path, $content);
    }
775695
public function changeType($bucket, $key, $fileType)
    {
        $resource = \Qiniu\entry($bucket, $key);
        $path = '/chtype/' . $resource . '/type/' . $fileType;
        list(, $error) = $this->rsPost($path);
        return $error;
    }
942447
public static function create($content = null, $contentType = 'text/plain')
    {
        $instance = new static();

        $instance->content = $content;
        $instance->contentType = $contentType;

        return $instance;
    }
915512
public function setContentType($contentType)
    {
        if (is_bool(strpos($contentType, 'charset=')) && $this->charset) {
            $contentType .= '; charset=' . $this->charset;
        }
        
        $this->headers['Content-Type'] = $contentType;
        return $this;
    }
240002
public function setFileContent($content)
    {
        $this->getContent();

        if (!is_resource($content)) {
            $stream = fopen('php://memory', 'rwb+');
            fwrite($stream, $content);
            rewind($stream);
        } else {
            $stream = $content;
        }

        $this->content->setData($stream);

        return $this;
    }
575462
public static function create(string $path, string $asName = null, string $contentType = null): FileDownload
    {
        $self = new static(new File($path));

        if ($asName !== null) {
            $self->setAsName($asName);
        }

        if ($contentType !== null) {
            $self->setContentType($contentType);
        }

        return $self;
    }
447776
public function put($filename,$content,$type=''){
        switch(strtolower($type)){
            case 'f':       
                $kv         =   $this->getKv();
                $this->kvs[$filename] = $content;
                return $kv->set($filename,$content);
            case 'html':    
                $kv         =   $this->getKv();
                $content    =   time().$content;
                $this->htmls[$filename] =   $content;
                return $kv->set($filename,$content);
            default:
                $content    =   time().$content;
                if(!$this->mc->set($filename,$content,MEMCACHE_COMPRESSED,0)){
                    E(L('_STORAGE_WRITE_ERROR_').':'.$filename);
                }else{
                    $this->contents[$filename] = $content;
                    return true;
                }            
        }
    }
685440
public function setContentType(string $contentType, string $contentCharset = null): self
    {
        $this->contentType = $contentType;

        if ($contentCharset !== null) {
            $this->setContentCharset($contentCharset);
        }

        return $this;
    }
653602
public function setContentType(ContentType $contentType)
    {
        $this->contentTypeName = $contentType->getName();
        $this->contentTypeId = null;

        return parent::setContentType($contentType);
    }
1143318
public static void setFileProperties (final File file, final String contentType) throws IOException, FrameworkException {

		final java.io.File fileOnDisk = file.getFileOnDisk(false);
		final PropertyMap map         = new PropertyMap();

		map.put(StructrApp.key(File.class, "contentType"), contentType != null ? contentType : FileHelper.getContentMimeType(fileOnDisk, file.getProperty(File.name)));
		map.put(StructrApp.key(File.class, "size"),        FileHelper.getSize(fileOnDisk));
		map.put(StructrApp.key(File.class, "version"),     1);

		map.putAll(getChecksums(file, fileOnDisk));

		file.setProperties(file.getSecurityContext(), map);
	}
920481
public function setContenttype($contenttype)
    {
        if (is_string($contenttype)) {
            $contenttype = $this->app['storage']->getContenttype($contenttype);
        }

        $this->contenttype = $contenttype;
    }
125399
public function setContentType(string $contentType): void
    {
        $this->contentType = $contentType;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Content-Type', $contentType, true);
    }
730637
public static void setFileData(final File file, final byte[] fileData, final String contentType) throws FrameworkException, IOException {
		FileHelper.setFileData(file, fileData, contentType, true);
	}
767841
public void setContentType(String contentType) throws InvalidArgumentException {
    if (Strings.isNullOrEmpty(contentType)) {
      throw new InvalidArgumentException("empty content type");
    }

    this.contentType = contentType;
  }
213908
public static function write( $file, $content, $key = null ) 
	{
		return CCFile::write( static::path( $file, $key ), $content );
	}