SmartlingClient { public Stream<StringInfo> getStringInfos(String projectId, String fileUri) { PageFetcherOffsetAndLimitSplitIterator<StringInfo> iterator = new PageFetcherOffsetAndLimitSplitIterator<StringInfo>( (offset, limit) -> { Items<StringInfo> stringInfoItems = getSourceStrings( projectId, fileUri, offset, limit); return stringInfoItems.getItems(); }, LIMIT); return StreamSupport.stream(iterator, false); } SmartlingClient(OAuth2RestTemplate oAuth2RestTemplate); Stream<StringInfo> getStringInfos(String projectId, String fileUri); Items<File> getFiles(String projectId); String downloadFile(String projectId, String locale, String fileUri, boolean includeOriginalStrings, RetrievalType retrievalType); String downloadPublishedFile(String projectId, String locale, String fileUri, boolean includeOriginalStrings); void deleteFile(String projectId, String fileUri); FileUploadResponse uploadFile(String projectId, String fileUri, String fileType, String fileContent, String placeholderFormat, String placeholderFormatCustom); FileUploadResponse uploadLocalizedFile(String projectId,
                                                  String fileUri,
                                                  String fileType,
                                                  String localeId,
                                                  String fileContent,
                                                  String placeholderFormat,
                                                  String placeholderFormatCustom); Items<StringInfo> getSourceStrings(String projectId, String fileUri, Integer offset, Integer limit); ContextUpload uploadContext(String projectId, String name, byte[] content); void createBindings(Bindings bindings, String projectId);  }
@Test public void testGetSourceStringsStream() { Assume.assumeNotNull(smartlingTestConfig.projectId); Assume.assumeNotNull(smartlingTestConfig.fileUri); smartlingClient.getStringInfos(smartlingTestConfig.projectId, smartlingTestConfig.fileUri).forEach(stringInfo -> { if (stringInfo.getKeys().size() == 1) { logger.debug("hashcode: {}\nvariant: {}\nparsed string: {}\n stringtext: {}\nkeys:", stringInfo.getHashcode(), stringInfo.getStringVariant(), stringInfo.getParsedStringText(), stringInfo.getStringText()); stringInfo.getKeys().stream().forEach(key -> logger.debug("key: {}, file: {}", key.getKey(), key.getFileUri())); logger.debug("\n\n"); } }); }