Skip to content

Instantly share code, notes, and snippets.

@marcomorain
Last active January 3, 2016 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marcomorain/8477297 to your computer and use it in GitHub Desktop.
Save marcomorain/8477297 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 {
public class InvalidException extends Exception {
public InvalidException(String message) {
super(message);
}
public InvalidException(String message, Throwable cause) {
super(message, cause);
}
public InvalidException(Throwable cause) {
super(cause);
}
}
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