Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for openResource (0.75 sec)

  1. platforms/software/resources/src/main/java/org/gradle/internal/resource/transfer/AbstractExternalResourceAccessor.java

        @Override
        public <T> T withContent(ExternalResourceName location, boolean revalidate, ExternalResource.ContentAndMetadataAction<T> action) throws ResourceException {
            ExternalResourceReadResponse response = openResource(location, revalidate);
            if (response == null) {
                return null;
            }
    
            try (InputStream inputStream = response.openStream();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  2. platforms/software/resources-http/src/test/groovy/org/gradle/internal/resource/transport/http/HttpResourceListerTest.groovy

            }
            _ * metaData.getContentType() >> "text/html"
        }
    
        def "list returns null if HttpAccessor returns null"(){
            setup:
            accessorMock.openResource(new ExternalResourceName("http://testrepo/"), true)  >> null
            expect:
            null == lister.list(new ExternalResourceName("http://testrepo"))
        }
    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-http/src/integTest/groovy/org/gradle/internal/resource/transport/http/HttpResourceAccessorIntegrationTest.groovy

            }
            def httpResourceAccessor = new HttpResourceAccessor(http)
    
            when:
            10.times {
                concurrent.start {
                    100.times {
                        httpResourceAccessor.openResource(name, false).close()
                    }
                }
            }
            concurrent.finished()
    
            then:
            noExceptionThrown()
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  4. platforms/software/resources-http/src/main/java/org/gradle/internal/resource/transport/http/HttpResourceAccessor.java

        private final HttpClientHelper http;
    
        public HttpResourceAccessor(HttpClientHelper http) {
            this.http = http;
        }
    
        @Override
        @Nullable
        public HttpResponseResource openResource(final ExternalResourceName location, boolean revalidate) {
            String uri = location.getUri().toString();
            LOGGER.debug("Constructing external resource: {}", location);
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  5. platforms/software/resources-s3/src/test/groovy/org/gradle/internal/resource/transport/aws/s3/S3ResourceConnectorTest.groovy

                1 * getResource(uri) >> Mock(S3Object) {
                    getObjectMetadata() >> objectMetadata
                }
            }
    
            when:
            def s3Resource = new S3ResourceConnector(s3Client).openResource(name, false)
    
            then:
            s3Resource != null
    
            cleanup:
            s3Resource?.close()
        }
    
    
        def "should call close() on S3Object when getMetaData is called"() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  6. platforms/software/resources-gcs/src/test/groovy/org/gradle/internal/resource/transport/gcp/gcs/GcsResourceConnectorTest.groovy

        def "should get a resource"() {
            GcsClient gcsClient = Mock {
                1 * getResource(uri) >> new StorageObject()
            }
    
            when:
            def gcsResource = new GcsResourceConnector(gcsClient).openResource(name, false)
    
            then:
            gcsResource != null
        }
    
        def "should get a resource metaData"() {
            def lastModified = new DateTime(new Date())
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. platforms/software/resources-sftp/src/main/java/org/gradle/internal/resource/transport/sftp/SftpResourceAccessor.java

                contentLength = attributes.getSize();
            }
    
            return new DefaultExternalResourceMetaData(uri, lastModified, contentLength);
        }
    
        @Override
        public ExternalResourceReadResponse openResource(ExternalResourceName location, boolean revalidate) {
            ExternalResourceMetaData metaData = getMetaData(location, revalidate);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  8. platforms/software/resources-gcs/src/main/java/org/gradle/internal/resource/transport/gcp/gcs/GcsResourceConnector.java

            LOGGER.debug("Listing parent resources: {}", parent);
            return gcsClient.list(parent.getUri());
        }
    
        @Nullable
        @Override
        public ExternalResourceReadResponse openResource(ExternalResourceName location, boolean revalidate) throws ResourceException {
            LOGGER.debug("Attempting to get resource: {}", location);
            StorageObject gcsObject = gcsClient.getResource(location.getUri());
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  9. platforms/software/resources/src/main/java/org/gradle/internal/resource/transfer/UrlExternalResource.java

                return null;
            } catch (Exception e) {
                throw ResourceExceptions.getFailed(location.getUri(), e);
            }
        }
    
        @Nullable
        @Override
        public ExternalResourceReadResponse openResource(final ExternalResourceName location, boolean revalidate) throws ResourceException {
            try {
                URL url = location.getUri().toURL();
                final URLConnection connection = url.openConnection();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  10. platforms/software/resources-s3/src/main/java/org/gradle/internal/resource/transport/aws/s3/S3ResourceConnector.java

            LOGGER.debug("Listing parent resources: {}", parent);
            return s3Client.listDirectChildren(parent.getUri());
        }
    
        @Override
        public ExternalResourceReadResponse openResource(ExternalResourceName location, boolean revalidate) {
            LOGGER.debug("Attempting to get resource: {}", location);
            S3Object s3Object = s3Client.getResource(location.getUri());
            if (s3Object == null) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 4.9K bytes
    - Viewed (0)
Back to top