- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for withContentIfPresent (0.22 sec)
-
platforms/software/resources/src/test/groovy/org/gradle/internal/resource/transfer/AccessorBackedExternalResourceTest.groovy
def resource = new AccessorBackedExternalResource(name, resourceAccessor, resourceUploader, resourceLister, true) when: expectResourceRead(name, "1234") def result = resource.withContentIfPresent(action) then: result.result == "result 1" result.bytesRead == 4 1 * action.execute(_) >> { InputStream input -> input.text; "result 1" } 0 * _ when:
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Oct 12 19:38:08 UTC 2023 - 11.2K bytes - Viewed (0) -
platforms/software/resources/src/test/groovy/org/gradle/internal/resource/local/LocalFileStandInExternalResourceTest.groovy
def file = tmpDir.createFile("content") file.text = "1234" expect: def resource = new LocalFileStandInExternalResource(file, TestFiles.fileSystem()) def result = resource.withContentIfPresent(new ExternalResource.ContentAndMetadataAction<String>() { @Override String execute(InputStream inputStream, ExternalResourceMetaData metaData) throws IOException {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Oct 12 19:38:08 UTC 2023 - 14K bytes - Viewed (0) -
platforms/software/dependency-management/src/test/groovy/org/gradle/internal/resource/transfer/DefaultCacheAwareExternalResourceAccessorTest.groovy
1 * repository.resource(new ExternalResourceName("thing.sha1"), true) >> remoteSha1 1 * remoteSha1.withContentIfPresent(_) >> null 1 * repository.withProgressLogging() >> progressLoggingRepo 1 * progressLoggingRepo.resource(location, true) >> remoteResource 1 * remoteResource.withContentIfPresent(_) >> { ExternalResource.ContentAndMetadataAction a -> a.execute(new ByteArrayInputStream(), remoteMetaData)
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Tue Jan 02 17:19:47 UTC 2024 - 19.1K bytes - Viewed (0) -
platforms/software/dependency-management/src/main/java/org/gradle/internal/resource/transfer/DefaultCacheAwareExternalResourceAccessor.java
ExternalResourceName sha1Location = location.append(".sha1"); ExternalResource resource = delegate.resource(sha1Location, revalidate); ExternalResourceReadResult<HashCode> result = resource.withContentIfPresent(inputStream -> { String sha = IOUtils.toString(inputStream, StandardCharsets.US_ASCII); // Servers may return SHA-1 with leading zeros stripped
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Tue Oct 10 21:10:11 UTC 2023 - 11.2K bytes - Viewed (0) -
platforms/software/maven/src/main/java/org/gradle/api/publish/maven/internal/publisher/AbstractMavenPublisher.java
@Override @Nullable public ExternalResourceReadResult<Metadata> call() { return repository.resource(metadataResource).withContentIfPresent(inputStream -> { try { return new MetadataXpp3Reader().read(inputStream, false); } catch (Exception e) {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Mar 07 12:20:56 UTC 2024 - 15.7K bytes - Viewed (0)