当前位置: 首页>>代码示例>>Java>>正文


Java ObjectUtils类代码示例

本文整理汇总了Java中com.cloudinary.utils.ObjectUtils的典型用法代码示例。如果您正苦于以下问题:Java ObjectUtils类的具体用法?Java ObjectUtils怎么用?Java ObjectUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ObjectUtils类属于com.cloudinary.utils包,在下文中一共展示了ObjectUtils类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: upload

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
public void upload(File toUpload) throws IOException {

        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    lastResult = cloudinary.uploader().upload(toUpload, ObjectUtils.emptyMap());
                    last_public_id = (String) lastResult.get("public_id");
                } catch (IOException e) {
                    Platform.runLater(()->{
                        Notifications.create().title("Error").text("Network is unreachable").showError();
                    });
                    e.printStackTrace();
                }
            }
        });
        thread.run();

    }
 
开发者ID:maximova136,项目名称:j-demo,代码行数:20,代码来源:CloudHost.java

示例2: upload

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
@Override
public void upload(final File file, final String id, final ImageStorageFinishedListener listener) {
    new AsyncTask<Void, Void, Void>() {
        boolean success = false;
        @Override
        protected Void doInBackground(Void... voids) {
            Map params = ObjectUtils.asMap("public_id", id);

            try {
                cloudinary.uploader().upload(file, params);
                success = true;
            } catch (Exception e) {
                listener.onError(e.getMessage());
            }

            return null;
        }

        @Override
        protected void onPostExecute(Void aVoid) {
            if (success) {
                listener.onSuccess();
            }
        }
    }.execute();
}
 
开发者ID:micromasterandroid,项目名称:androidadvanced,代码行数:27,代码来源:CloudinaryImageStorage.java

示例3: doInBackground

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
@Override
protected String doInBackground(Void... params) {
    try{
        File file = new File(filePath);
        String fileName = file.getName();
        fileName = fileName.substring(0, fileName.lastIndexOf('.'));

        Map cloudinaryResult = cloudinary.uploader().upload(file, ObjectUtils.asMap("public_id", "profile_img/"+fileName));
        Log.d(TAG, cloudinaryResult.toString());

        return (String) cloudinaryResult.get("secure_url");
    } catch (IOException ioe) {
        return "Error Uploading File " + ioe.toString();
    } catch (RuntimeException run) {
        return "Error Uploading File " + run.toString();
    }
}
 
开发者ID:open-roboclub,项目名称:roboclub-amu,代码行数:18,代码来源:ImageUploader.java

示例4: uploadPhotoToAlbum

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
@Override
public String uploadPhotoToAlbum(String albumHash, File photo) {
    Map result;
    String publicId = albumHash + cropSuffixIfAvailable(photo.getName(), ".png");
    try {
        result = mCloudinary.uploader().upload(new BufferedInputStream(new FileInputStream
                (photo)), ObjectUtils.asMap("public_id", publicId));
    } catch (IOException e) {
        Log.e("HomeStuff", "Error uploading photo to cloudinary: " + e);
        return null;
    }
    Log.d("HomeStuff", "Upload result: " + result);
    if (result.containsKey("url")) {
        return (String) result.get("url");
    }
    return null;
}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:18,代码来源:CloudinaryController.java

示例5: CloudHost

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
CloudHost() {
    Map params = ObjectUtils.asMap(
            "cloud_name", "dira4xawu",
            "api_key", "596983916447626",
            "api_secret", "H-23JcrsPFmkwy7yWHoH2R8DmD8"
    );
    cloudinary = new Cloudinary(params);

}
 
开发者ID:maximova136,项目名称:j-demo,代码行数:10,代码来源:CloudHost.java

示例6: CloudinaryController

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
public CloudinaryController() {
    // do not mess with api_secret boys and girls...
    mCloudinary = new Cloudinary(ObjectUtils.asMap(
            "cloud_name", "whatsthat",
            "api_key", "573493652391299",
            "api_secret", "9w7fbIr3pQOSb63QEg0vRBSACvw"));
}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:8,代码来源:CloudinaryController.java

示例7: upload

import com.cloudinary.utils.ObjectUtils; //导入依赖的package包/类
public String upload(String file) throws IOException {
    Map uploadResult = cloudinary.uploader().upload(file, ObjectUtils.emptyMap());
    url = (String) uploadResult.get("url");
    return url;
}
 
开发者ID:guilhermehas,项目名称:Camera-UOttawa,代码行数:6,代码来源:Cloud.java


注:本文中的com.cloudinary.utils.ObjectUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。