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


Java AVFile.withAbsoluteLocalPath方法代码示例

本文整理汇总了Java中com.avos.avoscloud.AVFile.withAbsoluteLocalPath方法的典型用法代码示例。如果您正苦于以下问题:Java AVFile.withAbsoluteLocalPath方法的具体用法?Java AVFile.withAbsoluteLocalPath怎么用?Java AVFile.withAbsoluteLocalPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.avos.avoscloud.AVFile的用法示例。


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

示例1: makeAvFileList

import com.avos.avoscloud.AVFile; //导入方法依赖的package包/类
public static List<AVFile> makeAvFileList(List<String> imagesPaths){
    List<AVFile> avFiles = new ArrayList<>();
    if (imagesPaths != null){
        for (String imagesPath : imagesPaths) {
            String imageType = getImageType(imagesPath);
            if (imageType != null) {
                AVFile avFile = null;
                try {
                    avFile = AVFile.withAbsoluteLocalPath(getImageName(imageType), imagesPath);
                    avFile.getThumbnailUrl(true,100,100);
                    avFiles.add(avFile);
                } catch (FileNotFoundException e) {
                    NLog.i(TagUtil.makeTag(FileStorageHelper.class),e);
                }
            }
        }
    }
    return avFiles;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:20,代码来源:FileStorageHelper.java

示例2: uploadImages

import com.avos.avoscloud.AVFile; //导入方法依赖的package包/类
public List<ImageInfo> uploadImages (final List<String> imagesPaths){
    if (imagesPaths != null) {
        List<ImageInfo> imageInfos = new ArrayList<>();
        for (String imagesPath : imagesPaths) {
            String imageType = getImageType(imagesPath);
            if (imageType != null){
                try {
                    AVFile avFile = AVFile.withAbsoluteLocalPath(getImageName(imageType), imagesPath);
                    AvObjectSaveHelper.runSaveFileSync(avFile);
                    ImageInfo imageInfo = new ImageInfo();
                    imageInfo.setThumbnailUrl(avFile.getThumbnailUrl(true,100,100));
                    imageInfo.setBigImageUrl(avFile.getUrl());
                    imageInfos.add(imageInfo);
                }catch (Exception e){
                    NLog.e(TagUtil.makeTag(FileStorageHelper.class),e);
                }
            }
        }
        return imageInfos;
    }
    return null;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:23,代码来源:FileStorageHelper.java

示例3: onCrash

import com.avos.avoscloud.AVFile; //导入方法依赖的package包/类
@Override
public void onCrash(File file) {
    if (file != null && !Config.isDebugMode) {
        //接下来要在此处加入将闪退日志回传到服务器的功能
        try {
            AVFile avFile = AVFile.withAbsoluteLocalPath(file.getName(), file.getAbsolutePath());
            avFile.saveInBackground();
            // AVObject crash = new AVObject("Crash");
            // crash.put("user_tel", MyApplication.user);
            // crash.put("crash_log", avFile);
            // crash.saveInBackground();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:hkq325800,项目名称:YellowNote,代码行数:17,代码来源:SimpleCrashReporter.java

示例4: saveUserIcon

import com.avos.avoscloud.AVFile; //导入方法依赖的package包/类
/**
 * 保存文件
 *
 * @param path
 * @return
 * @throws AVException
 * @throws FileNotFoundException
 */
public static String saveUserIcon(String path) throws AVException, FileNotFoundException {
    String mUser = PreferenceUtils.getString(Config.KEY_USER, "", MyApplication.context);
    AVFile file = AVFile.withAbsoluteLocalPath(mUser + ".jpg", path);
    file.save();
    AVQuery<AVObject> query = new AVQuery<>("mUser");
    query.whereEqualTo("user_tel", mUser);
    AVObject user = query.getFirst();
    user.put("user_icon", file.getObjectId());
    user.save();
    return file.getObjectId();
}
 
开发者ID:hkq325800,项目名称:YellowNote,代码行数:20,代码来源:LoginService.java

示例5: saveUserIconById

import com.avos.avoscloud.AVFile; //导入方法依赖的package包/类
/**
 * 通过id保存用户icon
 *
 * @param path
 * @return
 * @throws AVException
 * @throws FileNotFoundException
 */
public static String saveUserIconById(String path) throws AVException, FileNotFoundException {
    String mUser = PreferenceUtils.getString(Config.KEY_USER, "", MyApplication.context);
    AVFile file = AVFile.withObjectId(PreferenceUtils.getString(Config.KEY_USERICON, "", MyApplication.context));
    file.delete();
    AVFile newFile = AVFile.withAbsoluteLocalPath(mUser + ".jpg", path);
    newFile.save();
    AVQuery<AVObject> query = new AVQuery<>("mUser");
    query.whereEqualTo("user_tel", mUser);
    AVObject user = query.getFirst();
    user.put("user_icon", newFile.getObjectId());
    user.save();
    return newFile.getObjectId();
}
 
开发者ID:hkq325800,项目名称:YellowNote,代码行数:22,代码来源:LoginService.java

示例6: upload

import com.avos.avoscloud.AVFile; //导入方法依赖的package包/类
public void upload() throws IOException, AVException {
	if (msg.getType() != Msg.Type.Audio && msg.getType() != Msg.Type.Image) {
		return;
	}
	String objectId = msg.getObjectId();
	if (objectId == null) {
		throw new NullPointerException("objectId mustn't be null");
	}
	String filePath = PathUtils.getChatFilePath(objectId);
	AVFile file = AVFile.withAbsoluteLocalPath(objectId, filePath);
	file.save();
	String url = file.getUrl();
	msg.setContent(url);
}
 
开发者ID:lanixzcj,项目名称:LoveTalkClient,代码行数:15,代码来源:MsgBuilder.java


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