I am having a little problem getting all of the file info from my Cloudboost file object. Here is the code that I am using to get the id, name and url of the file. The problem is that I can get back the id and the name; however, the url is is null and I don't know why or how to fix it. Any ideas??
class FileQuery extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
CloudQuery query = new CloudQuery("Pubs");
query.include("file");
query.equalTo("id", "U1YV132B");
try {
query.find(new CloudObjectArrayCallback() {
@Override
public void done(CloudObject[] x, CloudException t) throws CloudException {
if (x != null) {
for (int i = 0; i < x.length; i++) {
final CloudFile f = new CloudFile(x[i].getDocument());
f.fetch(new CloudFileArrayCallback() {
@Override
public void done(CloudFile[] x, CloudException t) throws CloudException {
Log.d("dozer74", "File Id: " + f.getId()); // This will print out
Log.d("dozer74", "File Name: " + f.getFileName()); // This will print out
Log.d("dozer74", "File URL: " + f.getFileUrl()); // This is null
}
});
}
}
}
});
} catch (CloudException e) {
e.printStackTrace();
}
return null;
}
}
Here is how I call this class
new FileQuery().execute();