Package railo.commons.net.http.httpclient4

Source Code of railo.commons.net.http.httpclient4.HTTPPatchFactory

package railo.commons.net.http.httpclient4;

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;

import railo.commons.lang.ClassUtil;
import railo.runtime.exp.ApplicationException;
import railo.runtime.exp.PageException;
import railo.runtime.op.Caster;

public class HTTPPatchFactory {
 
  public static HttpEntityEnclosingRequestBase getHTTPPatch(String url) throws PageException  {
    // try to load the class, perhaps class does not exists with older jars
    Class clazz = ClassUtil.loadClass(
        HttpEntityEnclosingRequestBase.class.getClassLoader(),
        "org.apache.http.client.methods.HttpPatch",null);
    if(clazz==null) throw new ApplicationException("cannot load class [org.apache.http.client.methods.HttpPatch], you have to update your apache-commons-http*** jars");
    try {
      return (HttpEntityEnclosingRequestBase) ClassUtil.loadInstance(clazz,new Object[]{url});
    }
    catch (Throwable t) {
      throw Caster.toPageException(t);
    }
   
   
    //FUTURE if we have the new jar for sure return new HttpPatch(url);
  }
}
TOP

Related Classes of railo.commons.net.http.httpclient4.HTTPPatchFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.