Package net.fortytwo.twitlogic.util.properties

Examples of net.fortytwo.twitlogic.util.properties.PropertyException


            double[][] results = new double[matches.size()][2];
            int i = 0;
            for (String s : matches) {
                String[] a = s.split(";");
                if (2 != a.length) {
                    throw new PropertyException("location value '" + s + "' does not have the format long;lat");
                }
                results[i][0] = Double.valueOf(a[0]);
                results[i][1] = Double.valueOf(a[1]);
                i++;
            }
View Full Code Here


        Set<User> users = new LinkedHashSet<User>();
        for (String key : props.stringPropertyNames()) {
            if (key.startsWith(TwitLogic.FOLLOWLIST)) {
                String listVal = props.getString(key);
                if (!CONFIG_LIST_PATTERN.matcher(listVal).matches()) {
                    throw new PropertyException("invalid list: " + listVal + " (should be of the form user_name/list_id)");
                }

                String[] parts = listVal.split("/");
                User user = new User(parts[0]);
                String listId = parts[1];

                List<User> l = client.getListMembers(user, listId);
                users.addAll(l);
            } else if (key.startsWith(TwitLogic.FOLLOWUSER)) {
                String screenName = props.getString(key);
                if (!CONFIG_USERNAME_PATTERN.matcher(screenName).matches()) {
                    throw new PropertyException("invalid screen name: " + screenName);
                }

                // Twitter requires user IDs (as opposed to screen names) for follow filters.
                User u = client.findUserInfo(screenName);
                users.add(u);
            } else if (key.startsWith(TwitLogic.FOLLOWFOLLOWED)) {
                String screenName = props.getString(key);
                if (!CONFIG_USERNAME_PATTERN.matcher(screenName).matches()) {
                    throw new PropertyException("invalid screen name: " + screenName);
                }

                // Twitter requires user IDs (as opposed to screen names) for follow filters.
                User u = client.findUserInfo(screenName);
View Full Code Here

TOP

Related Classes of net.fortytwo.twitlogic.util.properties.PropertyException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.