I use this line to build a drive query
request.setQ("fullText contains '" + originalFileName + "'");
However when the originalFilename contains a “‘” the request throws this error:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ {
"domain" : "global",
"location" : "q",
"locationType" : "parameter",
"message" : "Invalid Value",
"reason" : "invalid" } ], "message" : "Invalid Value" }
I understand why the error is thrown, but how do I build a search string to find the files that contain “faq’s”in the indexable text? Is there a wildcard character, or an escape character?
You should escape the
'with a\, so: