All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.firefly.mvc.web.support.URLParser Maven / Gradle / Ivy

There is a newer version: 4.0.3.2
Show newest version
package com.firefly.mvc.web.support;

import java.util.ArrayList;
import java.util.List;

public abstract class URLParser {
	
	public static List parse(String uri) {
		List ret = new ArrayList();
		int start = 1;
		int max = uri.length() - 1;
		
		for (int i = 1; i <= max; i++) {
			if(uri.charAt(i) == '/') {
				ret.add(uri.substring(start, i));
				start = i + 1;
			}
		}
		
		if(uri.charAt(max) != '/') 
			ret.add(uri.substring(start));
		return ret;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy