public static JenaHttpException create(int code, String msg) { if ( code == HttpSC.NOT_FOUND_404 ) return new JenaHttpNotFoundException(msg) ; return new JenaHttpException(code, msg) ; }
/** Delete (which means clear) the default model of a Dataset */ @Override public void deleteDefault() { updater.httpDelete() ; }
@Test public void get_01() { DatasetGraphAccessor updater = getDatasetUpdater() ; Graph graph = updater.httpGet() ; assertNullOrEmpty(graph) ; Graph graph2 = updater.httpGet(n1) ; }
public static boolean isError(int code) { return isClientError(code) || isServerError(code) ; }
@Override public Graph httpGet() { return doGet(targetDefault()) ; }
@Override public void httpDelete() { doDelete(targetDefault()) ; }
@Override public void httpPost(Graph data) { doPost(targetDefault(), data) ; }
@Override public String toString() { return "HTTP: "+statusCode+" "+getMessage() ; }
/** * Makes an graph level accessor over a local dataset * @param dataset Dataset * @return Accessor */ public static DatasetGraphAccessor make(DatasetGraph dataset) { return new DatasetGraphAccessorBasic(dataset) ; }
private static DatasetAccessor adapt(DatasetGraphAccessor dgu) { return new DatasetAdapter(dgu) ; }
/** * Simple test against an code to determine if it falls into the * <code>Success</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Success</code> messages. */ public boolean isSuccess() { return HttpSC.isSuccess(this._code); }
/** * Create a DatasetUpdater for the remote URL * * @param remote * Remote URL * @param client * HTTP Client */ public DatasetGraphAccessorHTTP(String remote, HttpClient client) { this.remote = remote ; this.setClient(client) ; }
@Test public void get_02() { DatasetGraphAccessor updater = getDatasetUpdater() ; Graph graph = updater.httpGet(n1) ; assertNullOrEmpty(graph) ; }
public static JenaHttpException create(int code, String msg) { if ( code == HttpSC.NOT_FOUND_404 ) return new JenaHttpNotFoundException(msg) ; return new JenaHttpException(code, msg) ; }
/** Delete (which means clear) the default model of a Dataset */ @Override public void deleteDefault() { updater.httpDelete() ; }
@Override public String toString() { return "HTTP: "+statusCode+" "+getMessage() ; }