修改文件的MimeType

@param bucket 空间名称
@param key    文件名称
@param mime   文件的新MimeType
@throws QiniuException
@link http://developer.qiniu.com/kodo/api/chgm
507669
public Response changeMime(String bucket, String key, String mime)
            throws QiniuException {
        String resource = encodedEntry(bucket, key);
        String encodedMime = UrlSafeBase64.encodeToString(mime);
        String path = String.format("/chgm/%s/mime/%s", resource, encodedMime);
        return rsPost(bucket, path, null);
    }
835479
public function changeMime($bucket, $key, $mime){
        $err = $this->bucketManager->changeMime($bucket, $key, $mime);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功');
    }
562304
public String getResourceUrl(String bucketName, String key) {
        try {
            return getUrl(bucketName, key).toString();
        } catch ( Exception e ) {
            return null;
        }
    }
136675
public function changeType($bucket, $key, $type){
        if(!in_array($type, [0, 1])){
            return $this->error('文件存储类型错误', ['errorCode'=>-1]);
        }
        $err = $this->bucketManager->changeType($bucket, $key, $type);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功');
    }
997345
public Response put(File file, String key, String token, StringMap params,
                        String mime, boolean checkCrc) throws QiniuException {
        checkArgs(key, null, file, token);
        if (mime == null) {
            mime = Client.DefaultMime;
        }
        params = filterParam(params);
        long size = file.length();
        if (size <= configuration.putThreshold) {
            return new FormUploader(client, token, key, file, params, mime, checkCrc, configuration).upload();
        }

        ResumeUploader uploader = new ResumeUploader(client, token, key, file,
                params, mime, recorder, configuration);
        return uploader.upload();
    }
1028880
public void prefetch(String bucket, String key) throws QiniuException {
        String resource = encodedEntry(bucket, key);
        String path = String.format("/prefetch/%s", resource);
        Response res = ioPost(bucket, path);
        if (!res.isOK()) {
            throw new QiniuException(res);
        }
        res.close();
    }
1367599
public void setKey(String key) throws IOException {
    if (this.key != null) {
      throw new IOException("key already set");
    } else {
      this.key = Objects.requireNonNull(key, "key required");
    }
  }
413287
private function uploadMedia($fileName, $bucket, $key)
    {
        // init multi-part upload
        $initUploadResponse = $this->bosClient->initiateMultipartUpload($bucket, $key);
        $uploadId = $initUploadResponse->uploadId;

        // do upload part
        try {
            $offset = 0;
            $partNumber = 1;
            $partSize = BosClient::MIN_PART_SIZE;
            $length = $partSize;
            $partList = array();
            $bytesLeft = filesize($fileName);

            while ($bytesLeft > 0) {
                $length = ($length > $bytesLeft) ? $bytesLeft : $length;
                $uploadResponse = $this->bosClient->uploadPartFromFile(
                    $bucket,
                    $key,
                    $uploadId,
                    $partNumber,
                    $fileName,
                    $offset,
                    $length);
                array_push($partList, array(
                    'partNumber' => $partNumber,
                    'eTag' => $uploadResponse->metadata['etag'],
                ));
                $offset += $length;
                $partNumber++;
                $bytesLeft -= $length;
            }

            // complete upload
            $this->bosClient->completeMultipartUpload($bucket, $key, $uploadId, $partList);
        } catch (\Exception $e) {
            $this->bosClient->abortMultipartUpload($bucket, $key, $uploadId);
            throw $e;
        }
    }
822075
public void setMimeType(MimeType mimeType) {
        if (mimeType != null) {
            getState().mimeType = mimeType.getMimeType();
        } else {
            getState().mimeType = null;
        }
    }
1168269
public void add(String key, List<String> values) {

        if (m_frozen) {
            throw new IllegalStateException("Can not modify frozen CmsFlexBucketConfiguration");
        }
        m_bucketNames.add(key);
        m_bucketPathLists.add(values);
    }
353011
public function batchChangeMime($bucket, $keys, $mime){
        $keyMimePairs = array();
        foreach ($keys as $key) {
            $keyMimePairs[$key] = $mime;
        }
        $ops = $this->bucketManager->buildBatchChangeMime($bucket, $keyMimePairs);
        list($ret, $err) = $this->bucketManager->batch($ops);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功', $ret);
    }
89446
public String uploadToken(String bucket, String key) {
        return uploadToken(bucket, key, 3600, null, true);
    }
1073362
public synchronized void add(GenericKeys key) {
        KeyBucket bucket = makeBucket(key.getName().charAt(0));
        if (null != bucket) {
            bucket.add(key);
        }
    }
1306035
public boolean remove(long key) {
    for (Map<Long, Long> m : buckets) {
      if (m.remove(key) != null) {
        return true;
      }
    }
    return false;
  }
793126
public FileInfo stat(String bucket, String fileKey) throws QiniuException {
        Response res = rsGet(bucket, String.format("/stat/%s", encodedEntry(bucket, fileKey)));
        if (!res.isOK()) {
            throw new QiniuException(res);
        }
        FileInfo fileInfo = res.jsonToObject(FileInfo.class);
        res.close();
        return fileInfo;
    }
252128
public static void setEncryptionKey(final String key) {

		if (key == null) {

			logger.info("set_encryption_key() was called with null parameter, resetting global secret key");

			// reset hash
			secretKeyHash = null;
			return;
		}

		try {

			secretKeyHash = MessageDigest.getInstance(HASH_ALGO).digest(key.getBytes("UTF-8"));

		} catch (Throwable t) {
			logger.error("Unable to set secret key: {}", t.getMessage());
		}
	}
1346570
public JsonWriter keyUnescaped(CharSequence key) {
        startKey();

        if (key == null) {
            throw new IllegalArgumentException("Expected map key, but got null.");
        }

        writer.write('\"');
        writer.write(key.toString());
        writer.write('\"');
        writer.write(':');
        return this;

    }