麻烦与parse.com和“空间,撇号”

时间:2016-01-26 10:14:26

标签: android parse-platform

首先,解释一下情况...... 有写作数据到parse.com,一切运作良好。 以下是服务和下载数据的记录: 从parse.com下载数据

public ArrayList<MyObj> loadMyObjs() {
        Log.d("Parse", "MyObj");

        final ArrayList<MyObj> myObjs = new ArrayList<>();
        ParseQuery<ParseObject> query = ParseQuery.getQuery("MyObj");
        query.whereEqualTo("user", ParseUser.getCurrentUser());
        List<ParseObject> parseObjects = null;
        try {
            parseObjects = query.find();
            for (ParseObject object : parseObjects){
                MyObj myObj= new MyObj();
                myObj.setId(UUID.fromString((String) object.get(MyObj.JSON_ID)));
                myObj.setTitle(object.get(MyObj.JSON_TITLE).toString());
                myObj.setDetails(object.get(MyObj.JSON_DETAILS).toString());
                myObj.setParseId(object.getObjectId());
                myObjs.add(myObjs);
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return myObjs;
    }

将SaveObject保存到parse.com

public void saveMyObjss( ArrayList<MyObjs> myObjss){
        for(final MyObjs myObjs : myObjss) {
            ParseObject object = myObjs.getObject();
            if (isOnline()) {
                if (myObjs.getParseId() == null) {
                    Log.i("MyObjsParse", "myObjs == 1");
                    object.put(MyObjs.JSON_ID, myObjs.getId() + "");
                    if (myObjs.getTitle() == null) {
                        object.put(MyObjs.JSON_TITLE, "");
                    } else {
                        object.put(MyObjs.JSON_TITLE, myObjs.getTitle());
                    }

                    if (myObjs.getDetails() == null) {
                        object.put(MyObjs.JSON_DETAILS, "");
                    } else {
                        object.put(MyObjs.JSON_DETAILS, myObjs.getDetails());
                    }
                    object.put("user", ParseUser.getCurrentUser());
                    object.saveInBackground(new SaveCallback() {
                        @Override
                        public void done(ParseException e) {
                            Log.i("Save my myObjss", "MyObjs save(Parse)");
                        }
                    });
                } else {
                    if (myObjs.getParseId() != null) {
                        Log.i("MyObjsParse", "myObjs >>>>>> 0");
                        ParseQuery<ParseObject> query = ParseQuery.getQuery("MyObjs");
                        query.whereContains("user", ParseUser.getCurrentUser().toString());
                        Log.i("ObjectId", " " + myObjs.getParseId());
                        query.getInBackground(myObjs.getParseId(), new GetCallback<ParseObject>() {
                            @Override
                            public void done(ParseObject object, ParseException e) {
                                if (e == null) {
                                    object.put(MyObjs.JSON_ID, myObjs.getId() + "");
                                    object.put(MyObjs.JSON_TITLE, myObjs.getTitle());
                                    object.put(MyObjs.JSON_DETAILS, myObjs.getDetails());
                                    object.put("user", ParseUser.getCurrentUser());
                                    object.saveEventually(new SaveCallback() {
                                        @Override
                                        public void done(ParseException e) {
                                            Log.i("Save my myObjss", "MyObjs save(Parse)");
                                        }
                                    });
                                }
                            }
                        });
                    }
        }
    }

我有两个字段。这些字段记录标题和详细信息。当我输入空格或撇号时,存储在Parse.com上的数据非常正常。但是当我从Parsa.com使用(下载)数据时,执行:

parseObjects = query.find();

我收到错误,数据不下载。

01-25 22:03:08.211 2755-2755/com.admin.test W/System.err: com.parse.ParseRequest$ParseRequestException: i/o failure
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseRequest.newTemporaryException(ParseRequest.java:289)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseRequest$2.then(ParseRequest.java:144)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseRequest$2.then(ParseRequest.java:138)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task$15.run(Task.java:917)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at java.lang.Thread.run(Thread.java:856)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err: Caused by: java.io.IOException: unknown format (magic number 227b)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:101)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseDecompressInterceptor.intercept(ParseDecompressInterceptor.java:40)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseHttpClient$ParseNetworkInterceptorChain.proceed(ParseHttpClient.java:147)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParsePlugins$1.intercept(ParsePlugins.java:115)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseHttpClient$ParseNetworkInterceptorChain.proceed(ParseHttpClient.java:147)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseHttpClient.execute(ParseHttpClient.java:122)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseRequest$3.then(ParseRequest.java:135)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at com.parse.ParseRequest$3.then(ParseRequest.java:132)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task$15.run(Task.java:917)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task.completeAfterTask(Task.java:908)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task.continueWithTask(Task.java:715)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task.continueWithTask(Task.java:726)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task$13.then(Task.java:818)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:     at bolts.Task$13.then(Task.java:806)
01-25 22:03:08.211 2755-2755/com.admin.test W/System.err:   ... 4 more

当我从parse.com删除值空间或撇号时,一切正常!帮助确定什么错误?

0 个答案:

没有答案