You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2025/01/11 11:02:34 UTC
(jena) branch main updated (6e5fa6e7c0 -> 5f904cc8c3)
This is an automated email from the ASF dual-hosted git repository.
andy pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
from 6e5fa6e7c0 GH-2928: Workflow for checking dependency updates
new fdc03ac4ce Adjust logging messages during server start-up
new 7243da75a7 Archive Ruby SOH scripts
new 617ed7e706 Update assembly distro builder
new 1a1378a359 Tidy comments
new 6e8b170c9a Return actual type for timeout setter operations
new 5f904cc8c3 Update HttpSC
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../jena/sparql/exec/QueryExecBuilderAdapter.java | 12 +-
.../jena/sparql/exec/QueryExecDatasetBuilder.java | 17 +-
.../org/apache/jena/sparql/exec/QueryExecMod.java | 13 +-
.../sparql/exec/http/QueryExecHTTPBuilder.java | 8 +-
.../jena/sparql/modify/UpdateProcessorBase.java | 8 +-
.../src/main/java/org/apache/jena/web/HttpSC.java | 884 ++++++++++-----------
.../bin => jena-cmds/src/main/ruby}/s-delete | 0
.../bin => jena-cmds/src/main/ruby}/s-get | 0
.../bin => jena-cmds/src/main/ruby}/s-head | 0
.../bin => jena-cmds/src/main/ruby}/s-post | 0
.../bin => jena-cmds/src/main/ruby}/s-put | 0
.../bin => jena-cmds/src/main/ruby}/s-query | 0
.../bin => jena-cmds/src/main/ruby}/s-update | 0
.../bin => jena-cmds/src/main/ruby}/s-update-form | 0
.../bin => jena-cmds/src/main/ruby}/soh | 0
jena-fuseki2/apache-jena-fuseki/assembly-dist.xml | 25 +-
jena-fuseki2/apache-jena-fuseki/dist/README | 4 -
jena-fuseki2/apache-jena-fuseki/fuseki-backup | 2 +-
jena-fuseki2/apache-jena-fuseki/fuseki-server.bat | 2 +-
.../jena/fuseki/main/cmds/ArgCustomisers.java | 3 +-
.../apache/jena/fuseki/main/cmds/FusekiMain.java | 73 +-
.../jena/fuseki/main/sys/FusekiBuildCycle.java | 4 +-
.../apache/jena/fuseki/mod/admin/FMod_Admin.java | 1 -
.../apache/jena/fuseki/mod/shiro/FMod_Shiro.java | 2 +-
.../mod/shiro/ShiroEnvironmentLoaderListener.java | 2 +-
25 files changed, 503 insertions(+), 557 deletions(-)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-delete (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-get (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-head (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-post (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-put (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-query (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-update (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-update-form (100%)
rename {jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/soh (100%)
(jena) 06/06: Update HttpSC
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 5f904cc8c30184eaf3932bf93279f1b5655d3eb3
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed Jan 8 17:02:57 2025 +0000
Update HttpSC
---
.../src/main/java/org/apache/jena/web/HttpSC.java | 884 ++++++++++-----------
1 file changed, 418 insertions(+), 466 deletions(-)
diff --git a/jena-arq/src/main/java/org/apache/jena/web/HttpSC.java b/jena-arq/src/main/java/org/apache/jena/web/HttpSC.java
index 6414ea91ed..955f29dd00 100644
--- a/jena-arq/src/main/java/org/apache/jena/web/HttpSC.java
+++ b/jena-arq/src/main/java/org/apache/jena/web/HttpSC.java
@@ -16,472 +16,424 @@
* limitations under the License.
*/
-// ========================================================================
-// Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-
-//package org.eclipse.jetty.http;
-/* This code is a copy of the Jetty 7 HttpStatus class.
- * I found the naming which includes the number, more useful than the standard constants.
- */
-
package org.apache.jena.web;
-/**
- * <p>
- * HttpStatusCode enum class, for status codes based on various HTTP RFCs. (see
- * table below)
- * <ul>
- * <li><a href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>
- * <li><a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - HTTP/1.1</a>
- * <li><a href="http://tools.ietf.org/html/rfc2518">RFC 2518 - WEBDAV</a>
- * </ul>
- */
-public class HttpSC
-{
- public final static int CONTINUE_100 = 100;
- public final static int SWITCHING_PROTOCOLS_101 = 101;
- public final static int PROCESSING_102 = 102;
-
- public final static int OK_200 = 200;
- public final static int CREATED_201 = 201;
- public final static int ACCEPTED_202 = 202;
- public final static int NON_AUTHORITATIVE_INFORMATION_203 = 203;
- public final static int NO_CONTENT_204 = 204;
- public final static int RESET_CONTENT_205 = 205;
- public final static int PARTIAL_CONTENT_206 = 206;
- public final static int MULTI_STATUS_207 = 207;
-
- public final static int MULTIPLE_CHOICES_300 = 300;
- public final static int MOVED_PERMANENTLY_301 = 301;
- public final static int MOVED_TEMPORARILY_302 = 302;
- public final static int FOUND_302 = 302;
- public final static int SEE_OTHER_303 = 303;
- public final static int NOT_MODIFIED_304 = 304;
- public final static int USE_PROXY_305 = 305;
- public final static int TEMPORARY_REDIRECT_307 = 307;
-
- public final static int BAD_REQUEST_400 = 400;
- public final static int UNAUTHORIZED_401 = 401;
- public final static int PAYMENT_REQUIRED_402 = 402;
- public final static int FORBIDDEN_403 = 403;
- public final static int NOT_FOUND_404 = 404;
- public final static int METHOD_NOT_ALLOWED_405 = 405;
- public final static int NOT_ACCEPTABLE_406 = 406;
- public final static int PROXY_AUTHENTICATION_REQUIRED_407 = 407;
- public final static int REQUEST_TIMEOUT_408 = 408;
- public final static int CONFLICT_409 = 409;
- public final static int GONE_410 = 410;
- public final static int LENGTH_REQUIRED_411 = 411;
- public final static int PRECONDITION_FAILED_412 = 412;
- public final static int REQUEST_ENTITY_TOO_LARGE_413 = 413;
- public final static int REQUEST_URI_TOO_LONG_414 = 414;
- public final static int UNSUPPORTED_MEDIA_TYPE_415 = 415;
- public final static int REQUESTED_RANGE_NOT_SATISFIABLE_416 = 416;
- public final static int EXPECTATION_FAILED_417 = 417;
- public final static int I_AM_A_TEAPOT_418 = 418; // RFC 2324
- public final static int UNPROCESSABLE_ENTITY_422 = 422;
- public final static int LOCKED_423 = 423;
- public final static int FAILED_DEPENDENCY_424 = 424;
-
- public final static int INTERNAL_SERVER_ERROR_500 = 500;
- public final static int NOT_IMPLEMENTED_501 = 501;
- public final static int BAD_GATEWAY_502 = 502;
- public final static int SERVICE_UNAVAILABLE_503 = 503;
- public final static int GATEWAY_TIMEOUT_504 = 504;
- public final static int HTTP_VERSION_NOT_SUPPORTED_505 = 505;
- public final static int INSUFFICIENT_STORAGE_507 = 507;
-
- public static final int MAX_CODE = 507;
-
-
- private static final Code[] codeMap = new Code[MAX_CODE+1];
-
- static
- {
- for (Code code : Code.values())
- {
- codeMap[code._code] = code;
- }
- }
-
- public enum Code
- {
- /*
- * --------------------------------------------------------------------
- * Informational messages in 1xx series. As defined by ...
- * RFC 1945 - HTTP/1.0
- * RFC 2616 - HTTP/1.1
- * RFC 2518 - WebDAV
- * and RFC2324
- */
-
- /** <code>100 Continue</code> */
- CONTINUE(CONTINUE_100, "Continue"),
- /** <code>101 Switching Protocols</code> */
- SWITCHING_PROTOCOLS(SWITCHING_PROTOCOLS_101, "Switching Protocols"),
- /** <code>102 Processing</code> */
- PROCESSING(PROCESSING_102, "Processing"),
-
- /*
- * --------------------------------------------------------------------
- * Success messages in 2xx series. As defined by ... RFC 1945 - HTTP/1.0
- * RFC 2616 - HTTP/1.1 RFC 2518 - WebDAV
- */
-
- /** <code>200 OK</code> */
- OK(OK_200, "OK"),
- /** <code>201 Created</code> */
- CREATED(CREATED_201, "Created"),
- /** <code>202 Accepted</code> */
- ACCEPTED(ACCEPTED_202, "Accepted"),
- /** <code>203 Non Authoritative Information</code> */
- NON_AUTHORITATIVE_INFORMATION(NON_AUTHORITATIVE_INFORMATION_203, "Non Authoritative Information"),
- /** <code>204 No Content</code> */
- NO_CONTENT(NO_CONTENT_204, "No Content"),
- /** <code>205 Reset Content</code> */
- RESET_CONTENT(RESET_CONTENT_205, "Reset Content"),
- /** <code>206 Partial Content</code> */
- PARTIAL_CONTENT(PARTIAL_CONTENT_206, "Partial Content"),
- /** <code>207 Multi-Status</code> */
- MULTI_STATUS(MULTI_STATUS_207, "Multi-Status"),
-
- /*
- * --------------------------------------------------------------------
- * Redirection messages in 3xx series. As defined by ... RFC 1945 -
- * HTTP/1.0 RFC 2616 - HTTP/1.1
- */
-
- /** <code>300 Mutliple Choices</code> */
- MULTIPLE_CHOICES(MULTIPLE_CHOICES_300, "Multiple Choices"),
- /** <code>301 Moved Permanently</code> */
- MOVED_PERMANENTLY(MOVED_PERMANENTLY_301, "Moved Permanently"),
- /** <code>302 Moved Temporarily</code> */
- MOVED_TEMPORARILY(MOVED_TEMPORARILY_302, "Moved Temporarily"),
- /** <code>302 Found</code> */
- FOUND(FOUND_302, "Found"),
- /** <code>303 See Other</code> */
- SEE_OTHER(SEE_OTHER_303, "See Other"),
- /** <code>304 Not Modified</code> */
- NOT_MODIFIED(NOT_MODIFIED_304, "Not Modified"),
- /** <code>305 Use Proxy</code> */
- USE_PROXY(USE_PROXY_305, "Use Proxy"),
- /** <code>307 Temporary Redirect</code> */
- TEMPORARY_REDIRECT(TEMPORARY_REDIRECT_307, "Temporary Redirect"),
-
- /*
- * --------------------------------------------------------------------
- * Client Error messages in 4xx series. As defined by ... RFC 1945 -
- * HTTP/1.0 RFC 2616 - HTTP/1.1 RFC 2518 - WebDAV
- */
-
- /** <code>400 Bad Request</code> */
- BAD_REQUEST(BAD_REQUEST_400, "Bad Request"),
- /** <code>401 Unauthorized</code> */
- UNAUTHORIZED(UNAUTHORIZED_401, "Unauthorized"),
- /** <code>402 Payment Required</code> */
- PAYMENT_REQUIRED(PAYMENT_REQUIRED_402, "Payment Required"),
- /** <code>403 Forbidden</code> */
- FORBIDDEN(FORBIDDEN_403, "Forbidden"),
- /** <code>404 Not Found</code> */
- NOT_FOUND(NOT_FOUND_404, "Not Found"),
- /** <code>405 Method Not Allowed</code> */
- METHOD_NOT_ALLOWED(METHOD_NOT_ALLOWED_405, "Method Not Allowed"),
- /** <code>406 Not Acceptable</code> */
- NOT_ACCEPTABLE(NOT_ACCEPTABLE_406, "Not Acceptable"),
- /** <code>407 Proxy Authentication Required</code> */
- PROXY_AUTHENTICATION_REQUIRED(PROXY_AUTHENTICATION_REQUIRED_407, "Proxy Authentication Required"),
- /** <code>408 Request Timeout</code> */
- REQUEST_TIMEOUT(REQUEST_TIMEOUT_408, "Request Timeout"),
- /** <code>409 Conflict</code> */
- CONFLICT(CONFLICT_409, "Conflict"),
- /** <code>410 Gone</code> */
- GONE(GONE_410, "Gone"),
- /** <code>411 Length Required</code> */
- LENGTH_REQUIRED(LENGTH_REQUIRED_411, "Length Required"),
- /** <code>412 Precondition Failed</code> */
- PRECONDITION_FAILED(PRECONDITION_FAILED_412, "Precondition Failed"),
- /** <code>413 Request Entity Too Large</code> */
- REQUEST_ENTITY_TOO_LARGE(REQUEST_ENTITY_TOO_LARGE_413, "Request Entity Too Large"),
- /** <code>414 Request-URI Too Long</code> */
- REQUEST_URI_TOO_LONG(REQUEST_URI_TOO_LONG_414, "Request-URI Too Long"),
- /** <code>415 Unsupported Media Type</code> */
- UNSUPPORTED_MEDIA_TYPE(UNSUPPORTED_MEDIA_TYPE_415, "Unsupported Media Type"),
- /** <code>416 Requested Range Not Satisfiable</code> */
- REQUESTED_RANGE_NOT_SATISFIABLE(REQUESTED_RANGE_NOT_SATISFIABLE_416, "Requested Range Not Satisfiable"),
- /** <code>417 Expectation Failed</code> */
- EXPECTATION_FAILED(EXPECTATION_FAILED_417, "Expectation Failed"),
- /** <code>417 I'm a teapot</code>
- * The response MAY be short and stout.
- */
- I_AM_A_TEAPOT(I_AM_A_TEAPOT_418, "I'm a teapot"),
- /** <code>422 Unprocessable Entity</code> */
- UNPROCESSABLE_ENTITY(UNPROCESSABLE_ENTITY_422, "Unprocessable Entity"),
- /** <code>423 Locked</code> */
- LOCKED(LOCKED_423, "Locked"),
- /** <code>424 Failed Dependency</code> */
- FAILED_DEPENDENCY(FAILED_DEPENDENCY_424, "Failed Dependency"),
-
- /*
- * --------------------------------------------------------------------
- * Server Error messages in 5xx series. As defined by ... RFC 1945 -
- * HTTP/1.0 RFC 2616 - HTTP/1.1 RFC 2518 - WebDAV
- */
-
- /** <code>500 Server Error</code> */
- INTERNAL_SERVER_ERROR(INTERNAL_SERVER_ERROR_500, "Server Error"),
- /** <code>501 Not Implemented</code> */
- NOT_IMPLEMENTED(NOT_IMPLEMENTED_501, "Not Implemented"),
- /** <code>502 Bad Gateway</code> */
- BAD_GATEWAY(BAD_GATEWAY_502, "Bad Gateway"),
- /** <code>503 Service Unavailable</code> */
- SERVICE_UNAVAILABLE(SERVICE_UNAVAILABLE_503, "Service Unavailable"),
- /** <code>504 Gateway Timeout</code> */
- GATEWAY_TIMEOUT(GATEWAY_TIMEOUT_504, "Gateway Timeout"),
- /** <code>505 HTTP Version Not Supported</code> */
- HTTP_VERSION_NOT_SUPPORTED(HTTP_VERSION_NOT_SUPPORTED_505, "HTTP Version Not Supported"),
- /** <code>507 Insufficient Storage</code> */
- INSUFFICIENT_STORAGE(INSUFFICIENT_STORAGE_507, "Insufficient Storage");
-
- private final int _code;
- private final String _message;
-
- private Code(int code, String message)
- {
- this._code = code;
- _message=message;
- }
-
- public int getCode()
- {
- return _code;
- }
-
- public String getMessage()
- {
- return _message;
- }
-
-
- public boolean equals(int code)
- {
- return (this._code == code);
- }
-
- @Override
- public String toString()
- {
- return String.format("[%03d %s]",this._code,this.getMessage());
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Informational</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>Informational</code> messages.
- */
- public boolean isInformational()
- {
- return HttpSC.isInformational(this._code);
- }
-
- /**
- * 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);
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Redirection</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>Redirection</code> messages.
- */
- public boolean isRedirection()
- {
- return HttpSC.isRedirection(this._code);
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Client Error</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>Client Error</code> messages.
- */
- public boolean isClientError()
- {
- return HttpSC.isClientError(this._code);
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Server Error</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>Server Error</code> messages.
- */
- public boolean isServerError()
- {
- return HttpSC.isServerError(this._code);
- }
- }
-
-
- /**
- * Get the HttpStatusCode for a specific code
- *
- * @param code
- * the code to lookup.
- * @return the {@link HttpSC} if found, or null if not found.
- */
- public static Code getCode(int code)
- {
- if ( code < 0 )
- return null ;
-
- if (code <= MAX_CODE)
- {
- return codeMap[code];
- }
- return null;
- }
-
- /**
- * Get the status message for a specific code.
- *
- * @param code
- * the code to look up
- * @return the specific message, or the code number itself if code
- * does not match known list.
- */
- public static String getMessage(int code)
- {
- Code codeEnum = getCode(code);
- if (codeEnum != null)
- {
- return codeEnum.getMessage();
- }
- else
- {
- return Integer.toString(code);
- }
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Informational</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>.
- *
- * @param code
- * the code to test.
- * @return true if within range of codes that belongs to
- * <code>Informational</code> messages.
- */
- public static boolean isInformational(int code)
- {
- return ((100 <= code) && (code <= 199));
- }
-
- /**
- * 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>.
- *
- * @param code
- * the code to test.
- * @return true if within range of codes that belongs to
- * <code>Success</code> messages.
- */
- public static boolean isSuccess(int code)
- {
- return ((200 <= code) && (code <= 299));
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Redirection</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>.
- *
- * @param code
- * the code to test.
- * @return true if within range of codes that belongs to
- * <code>Redirection</code> messages.
- */
- public static boolean isRedirection(int code)
- {
- return ((300 <= code) && (code <= 399));
- }
-
- public static boolean isError(int code) {
- return isClientError(code) || isServerError(code) ;
- }
-
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Client Error</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>.
- *
- * @param code
- * the code to test.
- * @return true if within range of codes that belongs to
- * <code>Client Error</code> messages.
- */
- public static boolean isClientError(int code)
- {
- return ((400 <= code) && (code <= 499));
- }
-
- /**
- * Simple test against an code to determine if it falls into the
- * <code>Server Error</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>.
- *
- * @param code
- * the code to test.
- * @return true if within range of codes that belongs to
- * <code>Server Error</code> messages.
- */
- public static boolean isServerError(int code)
- {
- return ((500 <= code) && (code <= 599));
- }
+public class HttpSC {
+ // Original From Eclipse Jetty 12.0.16, license Apache-2.0
+ // org.eclipse.jetty.http.HttpStatus
+ // Header license applies to any local modifications.
+ //
+ // ========================================================================
+ // Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
+ //
+ // This program and the accompanying materials are made available under the
+ // terms of the Eclipse Public License v. 2.0 which is available at
+ // https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
+ // which is available at https://www.apache.org/licenses/LICENSE-2.0.
+ //
+ // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+ // ========================================================================
+ //
+
+
+// /**
+// * <p>
+// * Http Status Codes
+// * </p>
+// *
+// * @see <a href="http://www.iana.org/assignments/http-status-codes/">IANA HTTP Status Code Registry</a>
+// */
+// public class HttpStatus
+// {
+ public static final int CONTINUE_100 = 100;
+ public static final int SWITCHING_PROTOCOLS_101 = 101;
+ public static final int PROCESSING_102 = 102;
+ public static final int EARLY_HINTS_103 = 103;
+
+ public static final int OK_200 = 200;
+ public static final int CREATED_201 = 201;
+ public static final int ACCEPTED_202 = 202;
+ public static final int NON_AUTHORITATIVE_INFORMATION_203 = 203;
+ public static final int NO_CONTENT_204 = 204;
+ public static final int RESET_CONTENT_205 = 205;
+ public static final int PARTIAL_CONTENT_206 = 206;
+ public static final int MULTI_STATUS_207 = 207;
+
+ public static final int MULTIPLE_CHOICES_300 = 300;
+ public static final int MOVED_PERMANENTLY_301 = 301;
+ public static final int MOVED_TEMPORARILY_302 = 302;
+ public static final int FOUND_302 = 302;
+ public static final int SEE_OTHER_303 = 303;
+ public static final int NOT_MODIFIED_304 = 304;
+ public static final int USE_PROXY_305 = 305;
+ public static final int TEMPORARY_REDIRECT_307 = 307;
+ public static final int PERMANENT_REDIRECT_308 = 308;
+
+ public static final int BAD_REQUEST_400 = 400;
+ public static final int UNAUTHORIZED_401 = 401;
+ public static final int PAYMENT_REQUIRED_402 = 402;
+ public static final int FORBIDDEN_403 = 403;
+ public static final int NOT_FOUND_404 = 404;
+ public static final int METHOD_NOT_ALLOWED_405 = 405;
+ public static final int NOT_ACCEPTABLE_406 = 406;
+ public static final int PROXY_AUTHENTICATION_REQUIRED_407 = 407;
+ public static final int REQUEST_TIMEOUT_408 = 408;
+ public static final int CONFLICT_409 = 409;
+ public static final int GONE_410 = 410;
+ public static final int LENGTH_REQUIRED_411 = 411;
+ public static final int PRECONDITION_FAILED_412 = 412;
+ public static final int PAYLOAD_TOO_LARGE_413 = 413;
+ public static final int URI_TOO_LONG_414 = 414;
+ public static final int UNSUPPORTED_MEDIA_TYPE_415 = 415;
+ public static final int RANGE_NOT_SATISFIABLE_416 = 416;
+ public static final int EXPECTATION_FAILED_417 = 417;
+
+// @Deprecated
+// public static final int I_AM_A_TEAPOT_418 = 418;
+
+ public static final int IM_A_TEAPOT_418 = 418;
+ public static final int ENHANCE_YOUR_CALM_420 = 420;
+ public static final int MISDIRECTED_REQUEST_421 = 421;
+ public static final int UNPROCESSABLE_ENTITY_422 = 422;
+ public static final int LOCKED_423 = 423;
+ public static final int FAILED_DEPENDENCY_424 = 424;
+ public static final int UPGRADE_REQUIRED_426 = 426;
+ public static final int PRECONDITION_REQUIRED_428 = 428;
+ public static final int TOO_MANY_REQUESTS_429 = 429;
+ public static final int REQUEST_HEADER_FIELDS_TOO_LARGE_431 = 431;
+ public static final int UNAVAILABLE_FOR_LEGAL_REASONS_451 = 451;
+
+ public static final int INTERNAL_SERVER_ERROR_500 = 500;
+ public static final int NOT_IMPLEMENTED_501 = 501;
+ public static final int BAD_GATEWAY_502 = 502;
+ public static final int SERVICE_UNAVAILABLE_503 = 503;
+ public static final int GATEWAY_TIMEOUT_504 = 504;
+ public static final int HTTP_VERSION_NOT_SUPPORTED_505 = 505;
+ public static final int INSUFFICIENT_STORAGE_507 = 507;
+ public static final int LOOP_DETECTED_508 = 508;
+ public static final int NOT_EXTENDED_510 = 510;
+ public static final int NETWORK_AUTHENTICATION_REQUIRED_511 = 511;
+
+ public static final int MAX_CODE = 511;
+
+ private static final Code[] codeMap = new Code[MAX_CODE + 1];
+
+ static
+ {
+ for (Code code : Code.values())
+ {
+ codeMap[code._code] = code;
+ }
+ }
+
+ public enum Code
+ {
+ CONTINUE(CONTINUE_100, "Continue"),
+ SWITCHING_PROTOCOLS(SWITCHING_PROTOCOLS_101, "Switching Protocols"),
+ PROCESSING(PROCESSING_102, "Processing"),
+ EARLY_HINTS(EARLY_HINTS_103, "Early Hints"),
+
+ OK(OK_200, "OK"),
+ CREATED(CREATED_201, "Created"),
+ ACCEPTED(ACCEPTED_202, "Accepted"),
+ NON_AUTHORITATIVE_INFORMATION(NON_AUTHORITATIVE_INFORMATION_203, "Non Authoritative Information"),
+ NO_CONTENT(NO_CONTENT_204, "No Content"),
+ RESET_CONTENT(RESET_CONTENT_205, "Reset Content"),
+ PARTIAL_CONTENT(PARTIAL_CONTENT_206, "Partial Content"),
+ MULTI_STATUS(MULTI_STATUS_207, "Multi-Status"),
+
+ MULTIPLE_CHOICES(MULTIPLE_CHOICES_300, "Multiple Choices"),
+ MOVED_PERMANENTLY(MOVED_PERMANENTLY_301, "Moved Permanently"),
+ MOVED_TEMPORARILY(MOVED_TEMPORARILY_302, "Moved Temporarily"),
+ FOUND(FOUND_302, "Found"),
+ SEE_OTHER(SEE_OTHER_303, "See Other"),
+ NOT_MODIFIED(NOT_MODIFIED_304, "Not Modified"),
+ USE_PROXY(USE_PROXY_305, "Use Proxy"),
+ TEMPORARY_REDIRECT(TEMPORARY_REDIRECT_307, "Temporary Redirect"),
+ PERMANENT_REDIRECT(PERMANENT_REDIRECT_308, "Permanent Redirect"),
+
+ BAD_REQUEST(BAD_REQUEST_400, "Bad Request"),
+ UNAUTHORIZED(UNAUTHORIZED_401, "Unauthorized"),
+ PAYMENT_REQUIRED(PAYMENT_REQUIRED_402, "Payment Required"),
+ FORBIDDEN(FORBIDDEN_403, "Forbidden"),
+ NOT_FOUND(NOT_FOUND_404, "Not Found"),
+ METHOD_NOT_ALLOWED(METHOD_NOT_ALLOWED_405, "Method Not Allowed"),
+ NOT_ACCEPTABLE(NOT_ACCEPTABLE_406, "Not Acceptable"),
+ PROXY_AUTHENTICATION_REQUIRED(PROXY_AUTHENTICATION_REQUIRED_407, "Proxy Authentication Required"),
+ REQUEST_TIMEOUT(REQUEST_TIMEOUT_408, "Request Timeout"),
+ CONFLICT(CONFLICT_409, "Conflict"),
+ GONE(GONE_410, "Gone"),
+ LENGTH_REQUIRED(LENGTH_REQUIRED_411, "Length Required"),
+ PRECONDITION_FAILED(PRECONDITION_FAILED_412, "Precondition Failed"),
+ PAYLOAD_TOO_LARGE(PAYLOAD_TOO_LARGE_413, "Payload Too Large"),
+ URI_TOO_LONG(URI_TOO_LONG_414, "URI Too Long"),
+ UNSUPPORTED_MEDIA_TYPE(UNSUPPORTED_MEDIA_TYPE_415, "Unsupported Media Type"),
+ RANGE_NOT_SATISFIABLE(RANGE_NOT_SATISFIABLE_416, "Range Not Satisfiable"),
+ EXPECTATION_FAILED(EXPECTATION_FAILED_417, "Expectation Failed"),
+ IM_A_TEAPOT(IM_A_TEAPOT_418, "I'm a Teapot"),
+ ENHANCE_YOUR_CALM(ENHANCE_YOUR_CALM_420, "Enhance your Calm"),
+ MISDIRECTED_REQUEST(MISDIRECTED_REQUEST_421, "Misdirected Request"),
+ UNPROCESSABLE_ENTITY(UNPROCESSABLE_ENTITY_422, "Unprocessable Entity"),
+ LOCKED(LOCKED_423, "Locked"),
+ FAILED_DEPENDENCY(FAILED_DEPENDENCY_424, "Failed Dependency"),
+ UPGRADE_REQUIRED(UPGRADE_REQUIRED_426, "Upgrade Required"),
+ PRECONDITION_REQUIRED(PRECONDITION_REQUIRED_428, "Precondition Required"),
+ TOO_MANY_REQUESTS(TOO_MANY_REQUESTS_429, "Too Many Requests"),
+ REQUEST_HEADER_FIELDS_TOO_LARGE(REQUEST_HEADER_FIELDS_TOO_LARGE_431, "Request Header Fields Too Large"),
+ UNAVAILABLE_FOR_LEGAL_REASONS(UNAVAILABLE_FOR_LEGAL_REASONS_451, "Unavailable for Legal Reason"),
+
+ INTERNAL_SERVER_ERROR(INTERNAL_SERVER_ERROR_500, "Server Error"),
+ NOT_IMPLEMENTED(NOT_IMPLEMENTED_501, "Not Implemented"),
+ BAD_GATEWAY(BAD_GATEWAY_502, "Bad Gateway"),
+ SERVICE_UNAVAILABLE(SERVICE_UNAVAILABLE_503, "Service Unavailable"),
+ GATEWAY_TIMEOUT(GATEWAY_TIMEOUT_504, "Gateway Timeout"),
+ HTTP_VERSION_NOT_SUPPORTED(HTTP_VERSION_NOT_SUPPORTED_505, "HTTP Version Not Supported"),
+ INSUFFICIENT_STORAGE(INSUFFICIENT_STORAGE_507, "Insufficient Storage"),
+ LOOP_DETECTED(LOOP_DETECTED_508, "Loop Detected"),
+ NOT_EXTENDED(NOT_EXTENDED_510, "Not Extended"),
+ NETWORK_AUTHENTICATION_REQUIRED(NETWORK_AUTHENTICATION_REQUIRED_511, "Network Authentication Required"),
+
+ ;
+
+ private final int _code;
+ private final String _message;
+
+ private Code(int code, String message)
+ {
+ this._code = code;
+ _message = message;
+ }
+
+ public int getCode()
+ {
+ return _code;
+ }
+
+ public String getMessage()
+ {
+ return _message;
+ }
+
+ public boolean equals(int code)
+ {
+ return (this._code == code);
+ }
+
+ @Override
+ public String toString()
+ {
+ return String.format("[%03d %s]", this._code, this.getMessage());
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Informational</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/rfc7231">RFC 7231 -
+ * HTTP/1.1</a>.
+ *
+ * @return true if within range of codes that belongs to
+ * <code>Informational</code> messages.
+ */
+ public boolean isInformational()
+ {
+ return HttpSC.isInformational(this._code);
+ }
+
+ /**
+ * 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/rfc7231">RFC 7231 -
+ * 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);
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Redirection</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/rfc7231">RFC 7231 -
+ * HTTP/1.1</a>.
+ *
+ * @return true if within range of codes that belongs to
+ * <code>Redirection</code> messages.
+ */
+ public boolean isRedirection()
+ {
+ return HttpSC.isRedirection(this._code);
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Client Error</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/rfc7231">RFC 7231 -
+ * HTTP/1.1</a>.
+ *
+ * @return true if within range of codes that belongs to
+ * <code>Client Error</code> messages.
+ */
+ public boolean isClientError()
+ {
+ return HttpSC.isClientError(this._code);
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Server Error</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/rfc7231">RFC 7231 -
+ * HTTP/1.1</a>.
+ *
+ * @return true if within range of codes that belongs to
+ * <code>Server Error</code> messages.
+ */
+ public boolean isServerError()
+ {
+ return HttpSC.isServerError(this._code);
+ }
+ }
+
+ /**
+ * Get the HttpStatusCode for a specific code
+ *
+ * @param code the code to lookup.
+ * @return the {@link HttpSC} if found, or null if not found.
+ */
+ public static Code getCode(int code)
+ {
+ if (code <= MAX_CODE)
+ {
+ return codeMap[code];
+ }
+ return null;
+ }
+
+ /**
+ * Get the status message for a specific code.
+ *
+ * @param code the code to look up
+ * @return the specific message, or the code number itself if code
+ * does not match known list.
+ */
+ public static String getMessage(int code)
+ {
+ Code codeEnum = getCode(code);
+ if (codeEnum != null)
+ {
+ return codeEnum.getMessage();
+ }
+ else
+ {
+ return Integer.toString(code);
+ }
+ }
+
+ public static boolean hasNoBody(int status)
+ {
+ switch (status)
+ {
+ case NO_CONTENT_204:
+ case RESET_CONTENT_205:
+ case PARTIAL_CONTENT_206:
+ case NOT_MODIFIED_304:
+ return true;
+
+ default:
+ return status < OK_200;
+ }
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Informational</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/rfc7231">RFC 7231 - HTTP/1.1</a>.
+ *
+ * @param code the code to test.
+ * @return true if within range of codes that belongs to
+ * <code>Informational</code> messages.
+ */
+ public static boolean isInformational(int code)
+ {
+ return ((100 <= code) && (code <= 199));
+ }
+
+ /**
+ * Tests whether the status code is informational but not {@code 101 Switching Protocols}.
+ *
+ * @param code the code to test
+ * @return whether the status code is informational but not {@code 101 Switching Protocols}
+ */
+ public static boolean isInterim(int code)
+ {
+ return isInformational(code) && code != HttpSC.SWITCHING_PROTOCOLS_101;
+ }
+
+ /**
+ * 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/rfc7231">RFC 7231 - HTTP/1.1</a>.
+ *
+ * @param code the code to test.
+ * @return true if within range of codes that belongs to
+ * <code>Success</code> messages.
+ */
+ public static boolean isSuccess(int code)
+ {
+ return ((200 <= code) && (code <= 299));
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Redirection</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/rfc7231">RFC 7231 - HTTP/1.1</a>.
+ *
+ * @param code the code to test.
+ * @return true if within range of codes that belongs to
+ * <code>Redirection</code> messages.
+ */
+ public static boolean isRedirection(int code)
+ {
+ return ((300 <= code) && (code <= 399));
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Client Error</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/rfc7231">RFC 7231 - HTTP/1.1</a>.
+ *
+ * @param code the code to test.
+ * @return true if within range of codes that belongs to
+ * <code>Client Error</code> messages.
+ */
+ public static boolean isClientError(int code)
+ {
+ return ((400 <= code) && (code <= 499));
+ }
+
+ /**
+ * Simple test against an code to determine if it falls into the
+ * <code>Server Error</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/rfc7231">RFC 7231 - HTTP/1.1</a>.
+ *
+ * @param code the code to test.
+ * @return true if within range of codes that belongs to
+ * <code>Server Error</code> messages.
+ */
+ public static boolean isServerError(int code)
+ {
+ return ((500 <= code) && (code <= 599));
+ }
}
(jena) 02/06: Archive Ruby SOH scripts
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 7243da75a7568606e150a55b0c2635af73f0e309
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Thu Jan 2 15:12:36 2025 +0000
Archive Ruby SOH scripts
---
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-delete | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-get | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-head | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-post | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-put | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-query | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-update | 0
.../apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/s-update-form | 0
{jena-fuseki2/apache-jena-fuseki/bin => jena-cmds/src/main/ruby}/soh | 0
9 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-delete b/jena-cmds/src/main/ruby/s-delete
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-delete
rename to jena-cmds/src/main/ruby/s-delete
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-get b/jena-cmds/src/main/ruby/s-get
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-get
rename to jena-cmds/src/main/ruby/s-get
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-head b/jena-cmds/src/main/ruby/s-head
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-head
rename to jena-cmds/src/main/ruby/s-head
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-post b/jena-cmds/src/main/ruby/s-post
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-post
rename to jena-cmds/src/main/ruby/s-post
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-put b/jena-cmds/src/main/ruby/s-put
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-put
rename to jena-cmds/src/main/ruby/s-put
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-query b/jena-cmds/src/main/ruby/s-query
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-query
rename to jena-cmds/src/main/ruby/s-query
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-update b/jena-cmds/src/main/ruby/s-update
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-update
rename to jena-cmds/src/main/ruby/s-update
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/s-update-form b/jena-cmds/src/main/ruby/s-update-form
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/s-update-form
rename to jena-cmds/src/main/ruby/s-update-form
diff --git a/jena-fuseki2/apache-jena-fuseki/bin/soh b/jena-cmds/src/main/ruby/soh
similarity index 100%
rename from jena-fuseki2/apache-jena-fuseki/bin/soh
rename to jena-cmds/src/main/ruby/soh
(jena) 03/06: Update assembly distro builder
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 617ed7e70674039cff370c5dd3248f7c9ec04a3a
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Thu Jan 2 15:15:19 2025 +0000
Update assembly distro builder
---
jena-fuseki2/apache-jena-fuseki/assembly-dist.xml | 25 ++++++++---------------
jena-fuseki2/apache-jena-fuseki/dist/README | 4 ----
jena-fuseki2/apache-jena-fuseki/fuseki-backup | 2 +-
jena-fuseki2/apache-jena-fuseki/fuseki-server.bat | 2 +-
4 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/jena-fuseki2/apache-jena-fuseki/assembly-dist.xml b/jena-fuseki2/apache-jena-fuseki/assembly-dist.xml
index f55ec0417f..438adc0ed3 100644
--- a/jena-fuseki2/apache-jena-fuseki/assembly-dist.xml
+++ b/jena-fuseki2/apache-jena-fuseki/assembly-dist.xml
@@ -43,23 +43,15 @@
<outputFileNameMapping>fuseki-server.jar</outputFileNameMapping>
</dependencySet>
</dependencySets>
-
- <files>
- <file>
- <source>dist/LICENSE</source>
- <destName>LICENSE</destName>
- </file>
- <file>
- <source>dist/NOTICE</source>
- <destName>NOTICE</destName>
- </file>
- <file>
- <source>dist/README</source>
- <destName>README</destName>
- </file>
- </files>
-
+
<fileSets>
+
+ <fileSet>
+ <!-- NOTICE, LICENSE, README -->
+ <directory>dist</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+
<fileSet>
<outputDirectory></outputDirectory>
<includes>
@@ -86,7 +78,6 @@
<includes>
<include>fuseki-server</include>
<include>fuseki-backup</include>
- <include>bin/*</include>
</includes>
</fileSet>
diff --git a/jena-fuseki2/apache-jena-fuseki/dist/README b/jena-fuseki2/apache-jena-fuseki/dist/README
index aac1b23bbb..509cab04e0 100644
--- a/jena-fuseki2/apache-jena-fuseki/dist/README
+++ b/jena-fuseki2/apache-jena-fuseki/dist/README
@@ -17,10 +17,6 @@ The script 'fuseki' is a Linux init script to run Fuseki as an OS service.
The file 'fuseki.service' is a systemd unit file to run Fuseki2 as a service.
Instructions are in comments at the start of the files.
-The directory 'bin/' contains some scripts execute SPARQL Protocol and
-SPARQL Graph Store Protocol operations.
-Documentation: http://jena.apache.org/documentation/fuseki2/soh.html
-
A WAR file to run Fuseki in a webapp container server, such as Apache
Tomcat, can be obtained from https://downloads.apache.org/jena/binaries/
or https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-war/.
diff --git a/jena-fuseki2/apache-jena-fuseki/fuseki-backup b/jena-fuseki2/apache-jena-fuseki/fuseki-backup
index 4a1df6b7ec..2b6e23c128 100755
--- a/jena-fuseki2/apache-jena-fuseki/fuseki-backup
+++ b/jena-fuseki2/apache-jena-fuseki/fuseki-backup
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
diff --git a/jena-fuseki2/apache-jena-fuseki/fuseki-server.bat b/jena-fuseki2/apache-jena-fuseki/fuseki-server.bat
index b9656e2366..5ab6e0f058 100644
--- a/jena-fuseki2/apache-jena-fuseki/fuseki-server.bat
+++ b/jena-fuseki2/apache-jena-fuseki/fuseki-server.bat
@@ -16,7 +16,7 @@
@echo off
@REM modify this to name the server jar
-java -Xmx1500M -cp fuseki-server.jar org.apache.jena.fuseki.main.cmds.FusekiServerCmd %*
+java -Xmx4G -cp fuseki-server.jar org.apache.jena.fuseki.main.cmds.FusekiServerCmd %*
@REM Adding custom code to the Fuseki server:
@REM
(jena) 04/06: Tidy comments
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 1a1378a359361928c3b74ae3fd9ad64449c6cdd9
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Mon Jan 6 11:11:59 2025 +0000
Tidy comments
---
.../jena/fuseki/main/cmds/ArgCustomisers.java | 3 +-
.../apache/jena/fuseki/main/cmds/FusekiMain.java | 73 +++++++++++-----------
.../jena/fuseki/main/sys/FusekiBuildCycle.java | 4 +-
3 files changed, 38 insertions(+), 42 deletions(-)
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/ArgCustomisers.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/ArgCustomisers.java
index c83b2fc1de..b022ba6fe3 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/ArgCustomisers.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/ArgCustomisers.java
@@ -28,8 +28,7 @@ import org.apache.jena.fuseki.main.sys.FusekiModules;
import org.apache.jena.fuseki.main.sys.FusekiServerArgsCustomiser;
/**
- * The list of {@link FusekiServerArgsCustomiser} used by FusekiMain.
- *
+ * The list of {@link FusekiServerArgsCustomiser FusekiServerArgsCustomisers} used by FusekiMain.
*/
class ArgCustomizers {
private ArgCustomizers(){}
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiMain.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiMain.java
index 6f4636b730..be5a6314a8 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiMain.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiMain.java
@@ -222,12 +222,6 @@ public class FusekiMain extends CmdARQ {
action.accept(customiser);
}
}
-//
-// private List<FusekiServerArgsCustomiser> customiseServerArgs() {
-// if ( customiseServerArgs == null )
-// customiseServerArgs = new arrayList<>();
-// return customiseServerArgs;
-// }
// Customiser Lifecycle
//
@@ -243,8 +237,8 @@ public class FusekiMain extends CmdARQ {
// -- End of applyServerArgs
// ---- FusekiServerArgsCustomiser.serverArgsBuilder(FusekiServer.Builder serverBuilder, Model configModel)
- // == builder.build.
- // Decide FusekiModules
+ // == Enter the build lifecycle in builder.build().
+ // Decide FusekiModules for the build.
// --> then into FusekiBuildCycle.prepare(FusekiServer.Builder serverBuilder, Set<String> datasetNames, Model configModel) { }
protected FusekiMain(String... argv) {
@@ -255,8 +249,9 @@ public class FusekiMain extends CmdARQ {
}
private void argumentsSetup() {
+ modVersion.addClass("Fuseki", Fuseki.class);
+
getUsage().startCategory("Fuseki");
-
add(argConfig, "--config=FILE",
"Use a configuration file to determine the services");
// ---- Describe the dataset on the command line.
@@ -296,10 +291,8 @@ public class FusekiMain extends CmdARQ {
"https port (default port is 3043)");
add(argPasswdFile, "--passwd=FILE",
"Password file");
-
add(argTimeout, "--timeout=",
"Global timeout applied to queries (value in ms) -- format is X[,Y] ");
-
// ---- Servlets
add(argSparqler, "--sparqler=DIR",
"Run with SPARQLer services Directory for static content");
@@ -322,8 +315,6 @@ public class FusekiMain extends CmdARQ {
add(argEnableModules, "--modules=true|false", "Enable Fuseki autoloaded modules");
- super.modVersion.addClass("Fuseki", Fuseki.class);
-
applyCustomisers(customiser -> customiser.serverArgsModify(this, serverArgs));
}
@@ -640,32 +631,17 @@ public class FusekiMain extends CmdARQ {
@Override
protected void exec() {
- // Arguments have been processed to set serverArgs
- // Check for command line or config setup.
+ FusekiCoreInfo.logCode(Fuseki.serverLog);
+ FusekiServer server = execMakeServer();
+ execStartServer(server);
+ }
+
+ private FusekiServer execMakeServer() {
try {
- Logger log = Fuseki.serverLog;
- FusekiCoreInfo.logCode(log);
- FusekiServer server = makeServer(serverArgs);
- infoCmd(server, log);
- try {
- server.start();
- } catch (FusekiException ex) {
- if ( ex.getCause() instanceof BindException ) {
- if ( serverArgs.jettyConfigFile == null )
- Fuseki.serverLog.error("Failed to start server: "+ex.getCause().getMessage()+ ": port="+serverArgs.port);
- else
- Fuseki.serverLog.error("Failed to start server: "+ex.getCause().getMessage()+ ": port in use");
- System.exit(1);
- }
- throw ex;
- } catch (Exception ex) {
- throw new FusekiException("Failed to start server: " + ex.getMessage(), ex);
- }
- // This does not normally return.
- server.join();
- System.exit(0);
- }
- catch (AssemblerException | FusekiException ex) {
+ FusekiCoreInfo.logCode(Fuseki.serverLog);
+ // Arguments have been processed to produce serverArgs in processModulesAndArgs()
+ return makeServer(serverArgs);
+ } catch (AssemblerException | FusekiException ex) {
if ( ex.getCause() != null )
System.err.println(ex.getCause().getMessage());
else
@@ -674,6 +650,27 @@ public class FusekiMain extends CmdARQ {
}
}
+ private void execStartServer(FusekiServer server) {
+ infoCmd(server, Fuseki.serverLog);
+ try {
+ server.start();
+ } catch (FusekiException ex) {
+ if ( ex.getCause() instanceof BindException ) {
+ if ( serverArgs.jettyConfigFile == null )
+ Fuseki.serverLog.error("Failed to start server: "+ex.getCause().getMessage()+ ": port="+serverArgs.port);
+ else
+ Fuseki.serverLog.error("Failed to start server: "+ex.getCause().getMessage()+ ": port in use");
+ System.exit(1);
+ }
+ throw ex;
+ } catch (Exception ex) {
+ throw new FusekiException("Failed to start server: " + ex.getMessage(), ex);
+ }
+ // This does not normally return.
+ server.join();
+ System.exit(0);
+ }
+
/**
* Take a {@link ServerArgs} and make a {@Link FusekiServer}.
* The server has not been started.
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/sys/FusekiBuildCycle.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/sys/FusekiBuildCycle.java
index 33f865b3b1..31208bc69d 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/sys/FusekiBuildCycle.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/sys/FusekiBuildCycle.java
@@ -82,8 +82,8 @@ public interface FusekiBuildCycle {
/**
* This method is called for each {@link DataAccessPoint} by the default
- * implementation of {@link #configured} after the new servers
- * DataAccessPointRegistry has been built.
+ * implementation of {@link #configured} after the new server's
+ * {@link DataAccessPointRegistry} has been built.
*/
public default void configDataAccessPoint(DataAccessPoint dap, Model configModel) {}
(jena) 05/06: Return actual type for timeout setter operations
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 6e8b170c9a8ac01e3c65e129f9e2dc6f382965e8
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed Jan 8 10:47:29 2025 +0000
Return actual type for timeout setter operations
---
.../jena/sparql/exec/QueryExecBuilderAdapter.java | 12 ++++++++----
.../jena/sparql/exec/QueryExecDatasetBuilder.java | 17 +++++++++++------
.../java/org/apache/jena/sparql/exec/QueryExecMod.java | 13 +++++--------
.../jena/sparql/exec/http/QueryExecHTTPBuilder.java | 8 +++++++-
.../apache/jena/sparql/modify/UpdateProcessorBase.java | 8 ++++----
5 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecBuilderAdapter.java b/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecBuilderAdapter.java
index be6c951ef5..897abe353f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecBuilderAdapter.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecBuilderAdapter.java
@@ -36,8 +36,7 @@ import org.apache.jena.sparql.util.ModelUtils;
import org.apache.jena.sparql.util.Symbol;
/** QueryExecBuilder view over a QueryExecutionBuilder */
-public class QueryExecBuilderAdapter
- implements QueryExecBuilder
+public class QueryExecBuilderAdapter implements QueryExecBuilder
{
protected QueryExecutionBuilder builder;
@@ -143,11 +142,16 @@ public class QueryExecBuilderAdapter
}
@Override
- public QueryExecBuilder timeout(long value, TimeUnit timeUnit) {
- builder = builder.timeout(value, timeUnit);
+ public QueryExecBuilder timeout(long timeout, TimeUnit timeUnit) {
+ builder = builder.timeout(timeout, timeUnit);
return this;
}
+ @Override
+ public QueryExecBuilder timeout(long timeout) {
+ return timeout(timeout, TimeUnit.MILLISECONDS);
+ }
+
@Override
public QueryExec build() {
QueryExecution qExec = builder.build();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecDatasetBuilder.java b/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecDatasetBuilder.java
index 6ba3ead521..f028893669 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecDatasetBuilder.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecDatasetBuilder.java
@@ -163,20 +163,25 @@ public class QueryExecDatasetBuilder implements QueryExecMod, QueryExecBuilder {
}
@Override
- public QueryExecDatasetBuilder timeout(long value, TimeUnit timeUnit) {
- timeoutBuilder.timeout(value, timeUnit);
+ public QueryExecDatasetBuilder timeout(long timeout) {
+ return timeout(timeout, TimeUnit.MICROSECONDS);
+ }
+
+ @Override
+ public QueryExecDatasetBuilder timeout(long timeout, TimeUnit timeUnit) {
+ timeoutBuilder.timeout(timeout, timeUnit);
return this;
}
@Override
- public QueryExecDatasetBuilder initialTimeout(long value, TimeUnit timeUnit) {
- timeoutBuilder.initialTimeout(value, timeUnit);
+ public QueryExecDatasetBuilder initialTimeout(long timeout, TimeUnit timeUnit) {
+ timeoutBuilder.initialTimeout(timeout, timeUnit);
return this;
}
@Override
- public QueryExecDatasetBuilder overallTimeout(long value, TimeUnit timeUnit) {
- timeoutBuilder.overallTimeout(value, timeUnit);
+ public QueryExecDatasetBuilder overallTimeout(long timeout, TimeUnit timeUnit) {
+ timeoutBuilder.overallTimeout(timeout, timeUnit);
return this;
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecMod.java b/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecMod.java
index 3dc8b36566..167d312db4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecMod.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/exec/QueryExecMod.java
@@ -29,14 +29,11 @@ import org.apache.jena.sparql.util.Context;
*/
public interface QueryExecMod {
- public default QueryExecMod timeout(long timeout, TimeUnit timeoutUnits) {
- overallTimeout(timeout, timeoutUnits);
- return this;
- }
-
- public default QueryExecMod timeout(long timeout) {
- return timeout(timeout, TimeUnit.MILLISECONDS);
- }
+ // All "return QueryExec" These need overriding and returning the implementation class.
+
+ public QueryExecMod timeout(long timeout, TimeUnit timeoutUnits);
+
+ public QueryExecMod timeout(long timeout);
public QueryExecMod initialTimeout(long timeout, TimeUnit timeUnit);
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/exec/http/QueryExecHTTPBuilder.java b/jena-arq/src/main/java/org/apache/jena/sparql/exec/http/QueryExecHTTPBuilder.java
index 17afa987fb..d861b7f5b5 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/exec/http/QueryExecHTTPBuilder.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/exec/http/QueryExecHTTPBuilder.java
@@ -53,6 +53,12 @@ public class QueryExecHTTPBuilder extends ExecHTTPBuilder<QueryExecHTTP, QueryEx
timeout, timeoutUnit);
}
+ @Override
+ public QueryExecHTTPBuilder timeout(long timeout) {
+ timeout(timeout, TimeUnit.MILLISECONDS);
+ return thisBuilder();
+ }
+
@Override
public QueryExecHTTPBuilder initialTimeout(long timeout, TimeUnit timeUnit) {
throw new UnsupportedOperationException();
@@ -60,7 +66,7 @@ public class QueryExecHTTPBuilder extends ExecHTTPBuilder<QueryExecHTTP, QueryEx
@Override
public QueryExecHTTPBuilder overallTimeout(long timeout, TimeUnit timeUnit) {
- super.timeout(timeout, timeUnit);
+ timeout(timeout, timeUnit);
return thisBuilder();
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateProcessorBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateProcessorBase.java
index 8b738a9f12..d51b96e050 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateProcessorBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateProcessorBase.java
@@ -43,10 +43,10 @@ public class UpdateProcessorBase implements UpdateProcessor
@Deprecated
public UpdateProcessorBase(UpdateRequest request,
- DatasetGraph datasetGraph,
- Binding inputBinding,
- Context context,
- UpdateEngineFactory factory) {
+ DatasetGraph datasetGraph,
+ Binding inputBinding,
+ Context context,
+ UpdateEngineFactory factory) {
this(request, datasetGraph, inputBinding, context, factory, null);
}
(jena) 01/06: Adjust logging messages during server start-up
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit fdc03ac4ce685c489b456a7894e366a43823c5ce
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Thu Jan 2 12:39:30 2025 +0000
Adjust logging messages during server start-up
---
.../src/main/java/org/apache/jena/fuseki/mod/admin/FMod_Admin.java | 1 -
.../src/main/java/org/apache/jena/fuseki/mod/shiro/FMod_Shiro.java | 2 +-
.../apache/jena/fuseki/mod/shiro/ShiroEnvironmentLoaderListener.java | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/admin/FMod_Admin.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/admin/FMod_Admin.java
index c98e7b1628..eebda1acda 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/admin/FMod_Admin.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/admin/FMod_Admin.java
@@ -136,7 +136,6 @@ public class FMod_Admin implements FusekiModule {
serverCtl.setup();
Path fusekiBase = serverCtl.getFusekiBase();
builder.addServletAttribute(Fuseki.attrFusekiServerCtl, serverCtl);
- FmtLog.info(LOG, "Fuseki Admin: %s", fusekiBase);
// Shiro.
Path shiroIni = fusekiBase.resolve(FusekiServerCtl.DFT_SHIRO_INI);
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/FMod_Shiro.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/FMod_Shiro.java
index 419df8e337..add556c272 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/FMod_Shiro.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/FMod_Shiro.java
@@ -149,7 +149,7 @@ public class FMod_Shiro implements FusekiModule {
private final String shiroInitializationResource;
FusekiShiroFilter(String shiroResourceName) {
- // Shiro file: URLs are "file:<no encoding>"
+ // Shiro file -- URLs are "file:<no encoding>"
shiroInitializationResource = shiroResourceName;
}
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/ShiroEnvironmentLoaderListener.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/ShiroEnvironmentLoaderListener.java
index 13295bb6e1..6a650d34cd 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/ShiroEnvironmentLoaderListener.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/shiro/ShiroEnvironmentLoaderListener.java
@@ -69,7 +69,7 @@ class ShiroEnvironmentLoaderListener extends EnvironmentLoaderListener{
shiroConfigLog.info(format("No Shiro file found (tried: %s)", locations));
return;
}
- shiroConfigLog.info("Shiro file: "+loc);
+ shiroConfigLog.info("Shiro configuration: "+loc);
String[] configLocationsHere = new String[] {loc};
env.setConfigLocations(configLocationsHere);
}