• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ObjectUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FinalHttp类代码示例发布时间:2022-05-22
下一篇:
Java NSNumber类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap