Back to project page SIC.
The source code is released under:
MIT License
If you think the Android project SIC listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sun.imageloader.downloader.impl; /*from w ww.j a v a2s . c o m*/ import java.util.Locale; import android.text.TextUtils; public enum Scheme { HTTP("http"), HTTPS("https"), FILE("file"), UNKOWN(""); private String _scheme; Scheme(String scheme_) { _scheme = scheme_; } public static Scheme matchScheme(String imageUrl_){ if(!TextUtils.isEmpty(imageUrl_)){ for(Scheme scheme : values()){ if(scheme.isMatch(imageUrl_)) return scheme; } } return UNKOWN; } private boolean isMatch(String imageUrl_){ return imageUrl_.toLowerCase(Locale.US).startsWith(_scheme); } }