Skip to content

Instantly share code, notes, and snippets.

@robertclancy
Forked from marcomorain/gist:8477297
Created January 17, 2014 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertclancy/8477310 to your computer and use it in GitHub Desktop.
Save robertclancy/8477310 to your computer and use it in GitHub Desktop.
package com.swrve.babble;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import org.glassfish.jersey.uri.UriTemplate;
public class UrlTemplate {
private final String template;
public UrlTemplate(String template) {
this.template = template;
}
@Override
public String toString(){
return template;
}
public boolean isComplete() {
return template.indexOf('{') == -1;
}
public URL toUrl() throws MalformedURLException {
return new URL(template);
}
public URI toUri() throws URISyntaxException {
return new URI(template);
}
public UriTemplate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment