private ArchiveInstanceLocator createArchiveInstanceLocator(StoreContext context) throws InterruptedException, ExecutionException { StorageContext bulkdataContext = context.getBulkdataContext().get(); // waits for the store to finish ArchiveInstanceLocator newLocator = new ArchiveInstanceLocator.Builder( context.getInstance().getSopClassUID(), context.getInstance().getSopInstanceUID(), context.getFileRef().getTransferSyntaxUID()) .storageSystem(context.getStoreSession().getStorageSystem()) .storagePath(bulkdataContext.getFilePath().toString()) .entryName(context.getFileRef().getEntryName()) .fileTimeZoneID(context.getFileRef().getTimeZone()) .retrieveAETs(context.getInstance().getRawRetrieveAETs()) .withoutBulkdata(context.getFileRef().isWithoutBulkData()) .seriesInstanceUID(context.getAttributes().getString(Tag.SeriesInstanceUID)) .studyInstanceUID(context.getAttributes().getString(Tag.StudyInstanceUID)) .build(); byte[] encodedInstanceAttrs = context.getInstance().getAttributesBlob().getEncodedAttributes(); Attributes instanceAttrs = Utils.decodeAttributes(encodedInstanceAttrs); newLocator.setObject(instanceAttrs); return newLocator; }