I have media content, as in a byte stream, and I'm trying to load this stream in Google Drive.
Code:
private static String writeToGoogleDrive(Drive service, String title, String description, String parentId, String mimeType, final byte[] filename) throws IOException { String URL=""; File body = new File(); body.setTitle(title); body.setDescription(description); body.setMimeType(mimeType); if (parentId != null && parentId.length() > 0) { body.setParents(Arrays.asList(new ParentReference().setId(parentId))); } try { File file= service.files().insert(body, new AbstractInputStreamContent("") { @Override public boolean retrySupported() {
Exception: it just says null, but I don't know what (what) is null.
source share