Package io.microsphere.spring.net
Class SpringProtocolURLStreamHandler
java.lang.Object
java.net.URLStreamHandler
io.microsphere.net.ExtendableProtocolURLStreamHandler
io.microsphere.spring.net.SpringProtocolURLStreamHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.context.ResourceLoaderAware
public class SpringProtocolURLStreamHandler
extends io.microsphere.net.ExtendableProtocolURLStreamHandler
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware
The Spring
URLStreamHandler component supports supports the "spring" sub-protocols,
like "spring:{sub-protocol}:{ext-1}: ... :{ext-n}://...",
{sub-protocol} is required, each between {ext-1} to {ext-n} is the optional extension part.
for instance, "spring:resource:classpath://abc.properties",
- {sub-protocol} : "resource"
- {ext-1} : "classpath"
- Since:
- 1.0.0
- Author:
- Mercy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.springframework.core.io.ResourceLoaderprotected voidinitSubProtocolURLConnectionFactories(List<io.microsphere.net.SubProtocolURLConnectionFactory> factories) protected URLConnectionopenConnection(URL url, Proxy proxy) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetEnvironment(org.springframework.core.env.Environment environment) voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) Methods inherited from class io.microsphere.net.ExtendableProtocolURLStreamHandler
equals, getHandlePackages, getHandlePackagesPropertyValue, getProtocol, hashCode, hostsEqual, init, openConnection, openFallbackConnection, parseURL, reformSpec, resolveAuthority, resolvePath, resolveSubProtocols, toExternalForm, toStringMethods inherited from class java.net.URLStreamHandler
getDefaultPort, getHostAddress, sameFile, setURL, setURL
-
Field Details
-
PROTOCOL
- See Also:
-
-
Constructor Details
-
SpringProtocolURLStreamHandler
public SpringProtocolURLStreamHandler()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
initSubProtocolURLConnectionFactories
protected void initSubProtocolURLConnectionFactories(List<io.microsphere.net.SubProtocolURLConnectionFactory> factories) - Overrides:
initSubProtocolURLConnectionFactoriesin classio.microsphere.net.ExtendableProtocolURLStreamHandler
-
openConnection
- Overrides:
openConnectionin classio.microsphere.net.ExtendableProtocolURLStreamHandler- Throws:
IOException
-
getResourceLoader
public org.springframework.core.io.ResourceLoader getResourceLoader() -
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoaderin interfaceorg.springframework.context.ResourceLoaderAware
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment) - Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware
-