Package io.microsphere.spring.net
Class SpringPropertySourcesURLConnectionAdapter
- java.lang.Object
-
- java.net.URLConnection
-
- io.microsphere.spring.net.SpringPropertySourcesURLConnectionAdapter
-
public class SpringPropertySourcesURLConnectionAdapter extends java.net.URLConnection
TheURLConnection
adapter class is based on the SpringPropertySources
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
-
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
-
-
-
-
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 classjava.net.URLConnection
- Throws:
java.io.IOException
-
connect
public void connect() throws java.io.IOException
- Specified by:
connect
in classjava.net.URLConnection
- Throws:
java.io.IOException
-
-