class S3Helper {

    public DataStorageFile moveFile(String bucket, String oldPath, String newPath) throws DataStorageException {
        if (StringUtils.isNullOrEmpty(oldPath) || StringUtils.isNullOrEmpty(newPath)) {
            throw new DataStorageException(PATH_SHOULD_NOT_BE_EMPTY_MESSAGE);
        }
        AmazonS3 client = getDefaultS3Client();
        checkItemExists(client, bucket, oldPath, false);
        checkItemDoesNotExist(client, bucket, newPath, false);
        if (fileSizeExceedsLimit(client, bucket, oldPath)) {
            throw new DataStorageException(String.format("File '%s' moving was aborted because " +
                    "file size exceeds the limit of %s bytes", newPath, COPYING_FILE_SIZE_LIMIT));
        }
        moveS3Object(client, bucket, new MoveObjectRequest(oldPath, newPath));
        return getFile(client, bucket, newPath);
    }

}