Android Open Source - rss-parser Utils






From Project

Back to project page rss-parser.

License

The source code is released under:

Copyright (c) 2014 Artem Gapchenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the So...

If you think the Android project rss-parser listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package aga.rssparser;
//from   w  w  w. j  av a2 s .com
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author artem
 * Created on 17.08.14.
 */
public class Utils {
    private static final SimpleDateFormat RFC_822_FORMATTER = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");

    public static String capitalize(final String arg) {
        if (arg == null || arg.isEmpty()) {
            return arg;
        } else {
            return Character.toUpperCase(arg.charAt(0)) + arg.substring(1);
        }
    }

    public static Date toDate(final String value) {
        try {
            return RFC_822_FORMATTER.parse(value);
        } catch (ParseException e) {
            return new Date();
        }
    }
}




Java Source Code List

aga.rssparser.RSSReadException.java
aga.rssparser.RSSReader.java
aga.rssparser.Utils.java
aga.rssparser.model.Enclosure.java
aga.rssparser.model.FieldTypeAware.java
aga.rssparser.model.RSSChannel.java
aga.rssparser.model.RSSItem.java
aga.rssparser.sample.MainActivity.java
aga.rssparser.sample.RSSItemAdapter.java
aga.rssparser.sample.ViewHolder.java