-
-
Save robertclancy/8477310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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