移动文件。要求空间在同一账号下, 可以添加force参数为true强行移动文件。

@param fromBucket  源空间名称
@param fromFileKey 源文件名称
@param toBucket    目的空间名称
@param toFileKey   目的文件名称
@throws QiniuException
183196
public Response move(String fromBucket, String fromFileKey, String toBucket, String toFileKey)
            throws QiniuException {
        return move(fromBucket, fromFileKey, toBucket, toFileKey, false);
    }
861736
boolean insertToBucket(long bucketIndex, long tag) {

		for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) {
			if (checkTag(bucketIndex, i, 0)) {
				writeTagNoClear(bucketIndex, i, tag);
				return true;
			}
		}
		return false;
	}
894959
public static void copyFile(@NotNull Path from, @NotNull Path to) throws IOException {
		Validate.isTrue(Files.exists(from), "%s is not exist or not a file", from);
		Validate.notNull(to);
		Validate.isTrue(!FileUtil.isDirExists(to), "%s is exist but it is a dir", to);
		Files.copy(from, to);
	}
248378
private Bucket getOrCreateBucketForKey(Object key)
    {
        int index = getBucketIndexForKey(key);

        // Double-checked locking.  Safe since buckets do not initialize any state
        // until they are synchronized by the caller.                      d739870
        Bucket bucket = buckets[index];
        if (bucket == null)
        {
            synchronized (bucketLock)
            {
                bucket = buckets[index];
                if (bucket == null)
                {
                    // If this is to be a cache of EJB Wrappers, then create Wrapper
                    // specific buckets, that hold EJSWrapperCommon objects,
                    // otherwise create generic BucketImpl.                   d195605
                    bucket = wrappers ? new WrapperBucket(this) : new BucketImpl();
                    buckets[index] = bucket;
                }
            }
        }

        return bucket;
    }
1029579
@WorkerThread
  public static LottieResult<LottieComposition> fromZipStreamSync(ZipInputStream inputStream, @Nullable String cacheKey) {
    try {
      return fromZipStreamSyncInternal(inputStream, cacheKey);
    } finally {
      closeQuietly(inputStream);
    }
  }
150694
public static long readFullyToFile(InputStream is, File toFile)
            throws IOException {
        OutputStream os = org.apache.commons.io.FileUtils.openOutputStream(toFile); 
        try {
            return IOUtils.copyLarge(is, os);
        } finally {
            IOUtils.closeQuietly(os); 
            IOUtils.closeQuietly(is);
        }
    }
299360
public Response rename(String bucket, String oldFileKey, String newFileKey, boolean force)
            throws QiniuException {
        return move(bucket, oldFileKey, bucket, newFileKey, force);
    }
651617
public void uploadForDeployment(String from, String to) throws Exception {
        File fromFile = new File(from);
        if (!to.isEmpty() && fromFile.isDirectory())
            mkDir(to);
        else
            upload(from, to);


    }
482073
public static void copyFile(File from, File to) throws RuntimeIOException {
		copyFile(from, to, false);
	}
775695
public function changeType($bucket, $key, $fileType)
    {
        $resource = \Qiniu\entry($bucket, $key);
        $path = '/chtype/' . $resource . '/type/' . $fileType;
        list(, $error) = $this->rsPost($path);
        return $error;
    }
706492
private static void copy(Class<?> toType, Object to, Object... from) {
        int f = 0, fi = 0,
            length = Array.getLength(from[0]),
            total = from.length > 1 ? Array.getLength(to) : length;
        if ( Types.arrayDimensions(to.getClass()) == 1 ) {
            for ( int i = 0; i < total; i++ ) {
                Object value = Array.get(from[f], fi++);
                try {
                    value = Primitive.unwrap(
                            Types.castObject(value, toType, Types.CAST));
                } catch (UtilEvalError e) { /* ignore cast errors */ }
                if ( Byte.TYPE == toType )
                    Array.setByte(to, i, (byte) value);
                else if ( Short.TYPE == toType )
                    Array.setShort(to, i, (short) value);
                else if ( Integer.TYPE == toType )
                    Array.setInt(to, i, (int) value);
                else if ( Long.TYPE == toType )
                    Array.setLong(to, i, (long) value);
                else if ( Float.TYPE == toType )
                    Array.setFloat(to, i, (float) value);
                else if ( Double.TYPE == toType )
                    Array.setDouble(to, i, (double) value);
                else if ( Character.TYPE == toType )
                    Array.setChar(to, i, (char) value);
                else if ( Boolean.TYPE == toType )
                    Array.setBoolean(to, i, (boolean) value);
                else
                    Array.set(to, i, value);

                // concatenate multiple from arrays
                if ( length < total && fi == length && f+1 < from.length ) {
                    length = Array.getLength(from[++f]);
                    fi = 0;
                }
            }
        } else for ( int i = 0; i < total; i++ ) {
            // concatenate multiple from arrays
            if ( length < total && fi == length && f+1 < from.length ) {
                length = Array.getLength(from[++f]);
                fi = 0;
            }

            Object frm = Array.get(from[f], fi++);

            // null dimension example: new Integer[2][]
            if ( null == frm ) {
                Array.set(to, i, null);
                continue;
            }

            Object tto = Array.get(to, i);

            // mixed array lengths in multiple dimensions ex: {{1,2}, {3}}
            if ( Array.getLength(frm) != Array.getLength(tto) )
                Array.set(to, i,
                    tto = Array.newInstance(toType, dimensions(frm)));

            // recurse copy for next array dimension
            copy(toType, tto, frm);
        }
    }
1123979
public HttpURLConnection upload(String writeKey) throws IOException {
    HttpURLConnection connection = openConnection("https://api.segment.io/v1/import");
    connection.setRequestProperty("Authorization", authorizationHeader(writeKey));
    connection.setRequestProperty("Content-Encoding", "gzip");
    connection.setDoOutput(true);
    connection.setChunkedStreamingMode(0);
    return connection;
  }
1027938
public void renameFile(String from, String to) throws IOException {
    fs.rename(new Path(directory, from), new Path(directory, to));
  }
936056
public Blob moveTo(String destBucket, String destBlob) {
    // [START storageMoveFile]
    CopyWriter copyWriter = blob.copyTo(destBucket, destBlob);
    Blob copiedBlob = copyWriter.getResult();
    boolean deleted = blob.delete();
    // [END storageMoveFile]
    if (deleted) {
      return copiedBlob;
    } else {
      return null;
    }
  }
1136192
static <T extends Comparable<T>> void bucketSort(final List<T> c, final int fromIndex, final int toIndex) {
        bucketSort(c, fromIndex, toIndex, null);
    }
1060808
public String saveAs(String streamKey, String fileName, long start, long end) throws QiniuException {
        return saveAs(streamKey, fileName, start, end, null);
    }
471349
public void createEmptyObject(String key) throws QiniuException {
    com.qiniu.http.Response response =
        mUploadManager.put(new byte[0], key, mAuth.uploadToken(mBucketName, key));
    response.close();
  }