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

org.jboss.resteasy.plugins.delegates.UriHeaderDelegate Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package org.jboss.resteasy.plugins.delegates;

import javax.ws.rs.ext.RuntimeDelegate;
import java.net.URI;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class UriHeaderDelegate implements RuntimeDelegate.HeaderDelegate
{
   public Object fromString(String value) throws IllegalArgumentException
   {
      if (value == null) throw new IllegalArgumentException("URI value is null");
      return URI.create(value);
   }

   public String toString(Object value)
   {
      if (value == null) throw new IllegalArgumentException("param was null");
      URI uri = (URI) value;
      return uri.toASCIIString();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy