Class ResourceAccess


  • public class ResourceAccess
    extends java.lang.Object
    Static methods for accessing resources.

    These methods support data: and classpath: URIs directly. All other schemes are delegated to ResourceConnection.

    • Constructor Detail

      • ResourceAccess

        public ResourceAccess()
    • Method Detail

      • getResource

        public static ResourceResponse getResource​(ResourceRequest request)
                                            throws java.net.URISyntaxException,
                                                   java.io.IOException
        Attempt to get the requested resource.

        This method uses a ResourceRequest to formulate the request.

        Parameters:
        request - The request.
        Returns:
        The response.
        Throws:
        java.net.URISyntaxException - if the request URI is syntactically invalid.
        java.io.IOException - if the resource cannot be accessed.
      • getResource

        public static ResourceResponse getResource​(ResourceResponse response)
                                            throws java.net.URISyntaxException,
                                                   java.io.IOException
        Attempt to get the requested resource.

        This method uses a ResourceResponse to formulate the request, for example the response from a catalog lookup request.

        Parameters:
        response - The response.
        Returns:
        The response.
        Throws:
        java.net.URISyntaxException - if the request URI is syntactically invalid.
        java.io.IOException - if the resource cannot be accessed.