Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for writeToIfPresent (0.26 sec)

  1. platforms/software/resources/src/main/java/org/gradle/internal/resource/local/DefaultLocallyAvailableExternalResource.java

            return localFile.writeTo(destination);
        }
    
        @Override
        @Nullable
        public ExternalResourceReadResult<Void> writeToIfPresent(File destination) throws ResourceException {
            return localFile.writeToIfPresent(destination);
        }
    
        @Override
        public ExternalResourceReadResult<Void> writeTo(OutputStream destination) throws ResourceException {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  2. platforms/software/resources/src/main/java/org/gradle/internal/resource/AbstractExternalResource.java

        public String toString() {
            return getDisplayName();
        }
    
        @Override
        public ExternalResourceReadResult<Void> writeTo(File destination) {
            ExternalResourceReadResult<Void> result = writeToIfPresent(destination);
            if (result == null) {
                throw ResourceExceptions.getMissing(getURI());
            }
            return result;
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  3. 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, "12345")
            def result = resource.writeToIfPresent(file)
    
            then:
            result.bytesRead == 5
            file.text == "12345"
            0 * _
    
            when:
            expectResourceRead(name, "hi")
            result = resource.writeTo(file)
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  4. platforms/software/resources/src/test/groovy/org/gradle/internal/resource/local/LocalFileStandInExternalResourceTest.groovy

            def outFile = tmpDir.file("out")
            file.text = "1234"
    
            expect:
            def resource = new LocalFileStandInExternalResource(file, TestFiles.fileSystem())
            def result = resource.writeToIfPresent(outFile)
            result.bytesRead == 4
            outFile.text == "1234"
    
            file.setText("abc")
            def result2 = resource.writeTo(outFile)
            result2.bytesRead == 3
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 14K bytes
    - Viewed (0)
  5. platforms/software/resources/src/main/java/org/gradle/internal/resource/ExternalResource.java

         *
         * @return null if this resource does not exist.
         * @throws ResourceException on failure to copy the content.
         */
        @Nullable
        ExternalResourceReadResult<Void> writeToIfPresent(File destination) throws ResourceException;
    
        /**
         * Copies the binary contents of this resource to the given stream. Does not close the provided stream.
         *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  6. platforms/software/resources/src/main/java/org/gradle/internal/resource/transfer/AccessorBackedExternalResource.java

        }
    
        @Override
        public String getDisplayName() {
            return name.getDisplayName();
        }
    
        @Nullable
        @Override
        public ExternalResourceReadResult<Void> writeToIfPresent(File destination) throws ResourceException {
            return accessor.withContent(name, revalidate, inputStream -> {
                try (CountingInputStream input = new CountingInputStream(inputStream)) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  7. platforms/software/resources/src/main/java/org/gradle/internal/resource/local/LocalFileStandInExternalResource.java

            } catch (IOException e) {
                throw ResourceExceptions.getFailed(getURI(), e);
            }
        }
    
        @Override
        @Nullable
        public ExternalResourceReadResult<Void> writeToIfPresent(File destination) {
            if (!localFile.exists()) {
                return null;
            }
            try {
                CountingInputStream input = new CountingInputStream(new FileInputStream(localFile));
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 8.5K bytes
    - Viewed (0)
Back to top