We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`package com.xz.comm.net;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.blankj.utilcode.util.StringUtils; import com.xz.comm.constant.ResponseContants; import com.xz.comm.utils.StringExtUtils;
import org.xutils.http.app.ResponseParser; import org.xutils.http.request.UriRequest;
import java.io.File; import java.lang.reflect.Type;
/**
添加在params对象的注解参数中.
如果泛型为 byte[] 或 InputStream, 可以方便的转换protobuf对象. */ public class FileResponseParse implements ResponseParser {
}
报错信息: 2021-12-24 15:55:28.862 27666-27666/com.x.vi W/System.err: org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.x.vi/cache/xUtils_cache/ab750342e0211701ba4e4263281e0d64 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.cache.LruDiskCache.commitDiskCacheFile(LruDiskCache.java:226) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.cache.DiskCacheFile.commit(DiskCacheFile.java:31) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:151) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:242) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:41) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.ObjectLoader.load(ObjectLoader.java:90) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:79) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:296) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.HttpTask$RequestWorker.request(HttpTask.java:601) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.http.HttpTask.doBackground(HttpTask.java:298) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.common.task.TaskProxy$1.run(TaskProxy.java:73) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.common.task.PriorityRunnable.run(PriorityRunnable.java:21) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 2021-12-24 15:55:28.866 27666-27666/com.x.vi W/System.err: at java.lang.Thread.run(Thread.java:919)
2021-12-24 15:55:28.862 27666-27666/com.x.vi W/System.err: org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.x.vi/cache/xUtils_cache/ab750342e0211701ba4e4263281e0d64 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.cache.LruDiskCache.commitDiskCacheFile(LruDiskCache.java:226) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.cache.DiskCacheFile.commit(DiskCacheFile.java:31) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:151) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:242) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:41) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.ObjectLoader.load(ObjectLoader.java:90) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:79) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:296) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.HttpTask$RequestWorker.request(HttpTask.java:601) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.http.HttpTask.doBackground(HttpTask.java:298) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.common.task.TaskProxy$1.run(TaskProxy.java:73) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.common.task.PriorityRunnable.run(PriorityRunnable.java:21) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 2021-12-24 15:55:28.866 27666-27666/com.x.vi W/System.err: at java.lang.Thread.run(Thread.java:919)
The text was updated successfully, but these errors were encountered:
public class FileResponseParse implements ResponseParser<File> { 方法是这样的
public class FileResponseParse implements ResponseParser<File> {
Sorry, something went wrong.
No branches or pull requests
`package com.xz.comm.net;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.StringUtils;
import com.xz.comm.constant.ResponseContants;
import com.xz.comm.utils.StringExtUtils;
import org.xutils.http.app.ResponseParser;
import org.xutils.http.request.UriRequest;
import java.io.File;
import java.lang.reflect.Type;
/**
添加在params对象的注解参数中.
如果泛型为 byte[] 或 InputStream, 可以方便的转换protobuf对象.
*/
public class FileResponseParse implements ResponseParser {
/**
*/
private String sessionid = "";
/**
*/
@OverRide
public Object parse(Type resultType, Class<?> resultClass, File result) throws Throwable {
FileResponseEntity fileResponseEntity = new FileResponseEntity();
fileResponseEntity.setSessionid(sessionid);
if (result != null) {
fileResponseEntity.setFile(result);
}
return fileResponseEntity;
}
/**
*/
@OverRide
public void beforeRequest(UriRequest request) throws Throwable {
}
/**
*/
@OverRide
public void afterRequest(UriRequest request) throws Throwable {
try {
sessionid = request.getResponseHeader("sessionid");
} catch (Exception e) {
e.printStackTrace();
}
}
}
`
这点这个泛型为FIle.
报错信息:
2021-12-24 15:55:28.862 27666-27666/com.x.vi W/System.err: org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.x.vi/cache/xUtils_cache/ab750342e0211701ba4e4263281e0d64 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.cache.LruDiskCache.commitDiskCacheFile(LruDiskCache.java:226) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.cache.DiskCacheFile.commit(DiskCacheFile.java:31) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:151) 2021-12-24 15:55:28.863 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:242) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.FileLoader.load(FileLoader.java:41) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.loader.ObjectLoader.load(ObjectLoader.java:90) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:79) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:296) 2021-12-24 15:55:28.864 27666-27666/com.x.vi W/System.err: at org.xutils.http.HttpTask$RequestWorker.request(HttpTask.java:601) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.http.HttpTask.doBackground(HttpTask.java:298) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.common.task.TaskProxy$1.run(TaskProxy.java:73) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at org.xutils.common.task.PriorityRunnable.run(PriorityRunnable.java:21) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 2021-12-24 15:55:28.865 27666-27666/com.x.vi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 2021-12-24 15:55:28.866 27666-27666/com.x.vi W/System.err: at java.lang.Thread.run(Thread.java:919)
The text was updated successfully, but these errors were encountered: