Skip to content

Instantly share code, notes, and snippets.

@tremes
Created August 13, 2012 14:00
Show Gist options
  • Save tremes/3341009 to your computer and use it in GitHub Desktop.
Save tremes/3341009 to your computer and use it in GitHub Desktop.
@Command(value="url")
public void url(@Option(required=true) final Resource<?>[] urls, PipeOut out) throws IOException, URISyntaxException
{
for (Resource<?> url : urls)
{
out.println(url.getName());
if (url instanceof URLResource)
{
Desktop dt = Desktop.getDesktop();
out.println("SUPPORTED");
dt.browse(((URLResource) url).getUnderlyingResourceObject().toURI());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment