CubeOpenFileRequest request = new CubeOpenFileRequest();
request.setPubNum("CN202097706U");
request.setPubDate("20120104");
request.setFileCategory(PatentFileCategory.PDF);
request.setPatentCategory(PatentCategory.APP);
CubePatentFileResponse response = CLIENT.execute(request);
byte[] contentInBytes = cubePatentFileResponse.getFileByte();
File file = new File("/Users/file-test/test.pdf");
if (!file.exists()) {
file.createNewFile();
}
FileOutputStream fileOutputStream = new FileOutputStream(file);
fileOutputStream.write(contentInBytes);
fileOutputStream.flush();
fileOutputStream.close();
{
"errorCode":"500",
"fileByte":"AAAAAAAAAAAAAA==",
"msg":"pubDate cannot be null or empty!",
"success":false
}