Package io.microsphere.spring.net
Class SpringPropertySourcesURLConnectionAdapter
java.lang.Object
java.net.URLConnection
io.microsphere.spring.net.SpringPropertySourcesURLConnectionAdapter
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
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.util.MimeType
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SpringPropertySourcesURLConnectionAdapter
(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
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, 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, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
Field Details
-
DEFAULT_MEDIA_TYPE
public static final org.springframework.util.MimeType DEFAULT_MEDIA_TYPE
-
-
Constructor Details
-
SpringPropertySourcesURLConnectionAdapter
protected SpringPropertySourcesURLConnectionAdapter(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 Details
-
getInputStream
- Overrides:
getInputStream
in classURLConnection
- Throws:
IOException
-
connect
- Specified by:
connect
in classURLConnection
- Throws:
IOException
-