is URL a Local Uri starting with file:// - Android java.net

Android examples for java.net:URL

Description

is URL a Local Uri starting with file://

Demo Code

import android.text.TextUtils;
import java.util.Calendar;
import java.util.Date;

public class Main{


    public static boolean isLocalUri(String url) {
        boolean ret = false;

        if (url != null
                && (url.startsWith("file://") || url.startsWith("/"))) {
            ret = true;/*from   ww  w .  j a va  2 s  .c  o  m*/
        }

        return ret;
    }

}

Related Tutorials