Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for ReadAction (0.27 sec)

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

        public ExternalResourceReadResult<Void> withContent(Action<? super InputStream> readAction) throws ResourceException {
            return localFile.withContent(readAction);
        }
    
        @Override
        public <T> ExternalResourceReadResult<T> withContent(ContentAction<? extends T> readAction) throws ResourceException {
            return localFile.withContent(readAction);
        }
    
        @Override
        @Nullable
    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/core-execution/persistent-cache/src/main/java/org/gradle/cache/internal/BinaryStore.java

        BinaryData done();
    
        interface WriteAction {
            void write(Encoder encoder) throws IOException;
        }
    
        interface ReadAction<T> {
            T read(Decoder decoder) throws IOException;
        }
    
        interface BinaryData extends Closeable {
            <T> T read(ReadAction<T> readAction);
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:08:47 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  3. platforms/software/resources/src/main/java/org/gradle/internal/resource/AbstractExternalResource.java

            ExternalResourceReadResult<T> result = withContentIfPresent(readAction);
            if (result == null) {
                throw ResourceExceptions.getMissing(getURI());
            }
            return result;
        }
    
        @Override
        public <T> ExternalResourceReadResult<T> withContent(ContentAndMetadataAction<? extends T> readAction) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  4. platforms/software/resources/src/main/java/org/gradle/internal/resource/transfer/AccessorBackedExternalResource.java

        @Override
        public <T> ExternalResourceReadResult<T> withContentIfPresent(ContentAction<? extends T> readAction) throws ResourceException {
            return accessor.withContent(name, revalidate, inputStream -> {
                try (CountingInputStream input = new CountingInputStream(new BufferedInputStream(inputStream))) {
                    T value = readAction.execute(input);
                    return ExternalResourceReadResult.of(input.getCount(), value);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  5. platforms/software/dependency-management/src/test/groovy/org/gradle/api/internal/artifacts/ivyservice/resolveengine/store/DefaultBinaryStoreTest.groovy

            def data = store.done()
    
            then:
            data.read({ it.readInt() } as BinaryStore.ReadAction) == 10
            data.read({ it.readString() } as BinaryStore.ReadAction) == "x"
            data.close()
    
            then:
            data.read({ it.readInt() } as BinaryStore.ReadAction) == 10
            data.read({ it.readString() } as BinaryStore.ReadAction) == "x"
            data.close()
    
            cleanup:
            store.close()
    
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  6. platforms/software/dependency-management/src/test/groovy/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/DummyBinaryStore.groovy

        }
    
        BinaryData done() {
            new BinaryData() {
                Decoder decoder
                def <T> T read(ReadAction<T> readAction) {
                    if (decoder == null) {
                        decoder = new InputStreamBackedDecoder(new ByteArrayInputStream(bytes.toByteArray()))
                    }
                    readAction.read(decoder)
                }
    
                void close() {
                    decoder = null
                }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  7. platforms/software/resources/src/main/java/org/gradle/internal/resource/local/LocalFileStandInExternalResource.java

            if (!localFile.exists()) {
                throw ResourceExceptions.getMissing(getURI());
            }
            try {
                CountingInputStream input = new CountingInputStream(new BufferedInputStream(new FileInputStream(localFile)));
                try {
                    readAction.execute(input);
                } finally {
                    input.close();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  8. platforms/software/resources/src/main/java/org/gradle/internal/resource/ExternalResource.java

         * @throws org.gradle.api.resources.MissingResourceException when the resource does not exist
         */
        @SuppressWarnings("overloads")
        ExternalResourceReadResult<Void> withContent(Action<? super InputStream> readAction) throws ResourceException;
    
        /**
         * Executes the given action against the binary contents of this resource.
         *
         * @throws ResourceException on failure to read the content.
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  9. platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/ivyservice/resolveengine/store/DefaultBinaryStore.java

            public SimpleBinaryData(File inputFile, long offset) {
                this.inputFile = inputFile;
                this.offset = offset;
            }
    
            @Override
            public <T> T read(BinaryStore.ReadAction<T> readAction) {
                try {
                    if (decoder == null) {
                        RandomAccessFile randomAccess = new RandomAccessFile(inputFile, "r");
                        randomAccess.seek(offset);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 16 15:49:51 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  10. platforms/jvm/toolchains-jvm/src/test/groovy/org/gradle/jvm/toolchain/install/internal/SecureFileDownloaderTest.groovy

                            resource(_ as ExternalResourceName) >> Mock(ExternalResource) {
                                withContent(_ as Action<? super InputStream>) >> { Action<? super InputStream> readAction ->
                                    readAction.execute(new ByteArrayInputStream("foo".bytes))
                                    doAfterRead()
                                }
                            }
                        }
                    }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Jul 28 16:17:59 UTC 2023
    - 3.6K bytes
    - Viewed (0)
Back to top