Class SpringPropertySourcesURLConnectionAdapter


  • public class SpringPropertySourcesURLConnectionAdapter
    extends java.net.URLConnection
    The URLConnection adapter class is based on the Spring PropertySources

    The URL pattern : "spring:env:property-sources://{property-name-prefix}/{media-type}":

    • {property-name-prefix} : the prefix of property name, for instance : "microsphere." or "microsphere"
    • {media-type} : the media type, may be : "text/properties"(as default if absent) or "text/yaml"
    Since:
    1.0.0
    Author:
    Mercy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.springframework.util.MimeType DEFAULT_MEDIA_TYPE  
      • Fields inherited from class java.net.URLConnection

        allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SpringPropertySourcesURLConnectionAdapter​(java.net.URL url, org.springframework.core.env.PropertySources propertySources, org.springframework.core.convert.support.ConfigurableConversionService conversionService)
      Constructs a URL connection to the specified URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect()  
      java.io.InputStream getInputStream()  
      • Methods inherited from class java.net.URLConnection

        addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_MEDIA_TYPE

        public static final org.springframework.util.MimeType DEFAULT_MEDIA_TYPE
    • Constructor Detail

      • SpringPropertySourcesURLConnectionAdapter

        protected SpringPropertySourcesURLConnectionAdapter​(java.net.URL url,
                                                            org.springframework.core.env.PropertySources propertySources,
                                                            org.springframework.core.convert.support.ConfigurableConversionService conversionService)
        Constructs a URL connection to the specified URL. A connection to the object referenced by the URL is not created.
        Parameters:
        url - the specified URL.
        propertySources - PropertySources
        conversionService - ConfigurableConversionService
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Overrides:
        getInputStream in class java.net.URLConnection
        Throws:
        java.io.IOException
      • connect

        public void connect()
                     throws java.io.IOException
        Specified by:
        connect in class java.net.URLConnection
        Throws:
        java.io.IOException