@Override public boolean exists(BinaryGraphField field) { String uuid = field.getBinary().getUuid(); return new File(getFilePath(uuid)).exists(); }
@Override public boolean exists(BinaryGraphField field) { String id = field.getBinary().getSHA512Sum(); // NoSuchKeyException try { HeadObjectResponse headResponse = client.headObject(HeadObjectRequest.builder() .bucket(options.getBucketName()) .key(id) .build()).get(); } catch (InterruptedException | ExecutionException e) { // TODO Auto-generated catch block e.printStackTrace(); } return false; }
binaryFieldInfo.put("dominantColor", binaryField.getImageDominantColor()); Binary binary = binaryField.getBinary(); if (binary != null) { binaryFieldInfo.put("filesize", binary.getSize());
Binary binary = field.getBinary(); return binary == null ? 0 : binary.getUuid(); })); Binary binary = field.getBinary(); return binary == null ? 0 : binary.getImageWidth(); })); Binary binary = field.getBinary(); return binary == null ? 0 : binary.getImageHeight(); })); newFieldDefinition().name("sha512sum").description("SHA512 checksum of the binary data.").type(GraphQLString).dataFetcher(fetcher -> { BinaryGraphField field = fetcher.getSource(); return field.getBinary().getSHA512Sum(); })); return field.getBinary().getSize(); }));