Back to project page Wardrobe_app.
The source code is released under:
Apache License
If you think the Android project Wardrobe_app 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.android.busolo.apps.wardrobe.utils; /*from w w w . j a v a2s. c o m*/ /** * Created by s-brian on 5/24/2014. */ import android.text.format.Time; import java.util.regex.Pattern; public class ParserUtils { /** Used to sanitize a string to be {@link android.net.Uri} safe. */ private static final Pattern sSanitizePattern = Pattern.compile("[^a-z0-9-_]"); private static final Time sTime = new Time(); /** * Sanitize the given string to be {@link android.net.Uri} safe for building * {@link android.content.ContentProvider} paths. */ public static String sanitizeId(String input) { if (input == null) { return null; } return sSanitizePattern.matcher(input.replace("+", "plus").toLowerCase()).replaceAll(""); } /** * Parse the given string as a RFC 3339 timestamp, returning the value as * milliseconds since the epoch. */ public static long parseTime(String time) { sTime.parse3339(time); return sTime.toMillis(false); } }