From bc0d50a93963357c45feba0eb241591460c8e900 Mon Sep 17 00:00:00 2001 From: Jerome Louvel <374450+jlouvel@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:28:32 -0400 Subject: [PATCH] Deprecated WebDAV support Not relevant anymore, will help reduce footprint moving forward. --- .../java/org/restlet/client/data/Method.java | 29 ++++++++++++++----- .../java/org/restlet/client/data/Status.java | 25 ++++++++++++---- .../connector/WebDavProtocolHelper.java | 3 +- .../main/java/org/restlet/data/Method.java | 15 ++++++++++ .../main/java/org/restlet/data/Status.java | 13 +++++++++ .../main/java/org/restlet/engine/Engine.java | 1 + .../connector/WebDavProtocolHelper.java | 2 ++ 7 files changed, 74 insertions(+), 14 deletions(-) diff --git a/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Method.java b/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Method.java index 5fc05cb14b..6f22eb3857 100644 --- a/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Method.java +++ b/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Method.java @@ -35,6 +35,7 @@ public final class Method implements Comparable { private static final String BASE_HTTP = "http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html"; + @Deprecated private static final String BASE_WEBDAV = "http://www.webdav.org/specs/rfc2518.html"; /** @@ -56,7 +57,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.8 COPY Method - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method COPY = new Method( "COPY", "Creates a duplicate of the source resource, identified by the Request-URI, in the destination resource, identified by the URI in the Destination header", @@ -108,7 +111,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.10 LOCK Method - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method LOCK = new Method("LOCK", "Used to take out a lock of any access type (WebDAV)", BASE_WEBDAV + "#METHOD_LOCK", false, false); @@ -120,7 +125,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.3 MKCOL Method - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method MKCOL = new Method("MKCOL", "Used to create a new collection (WebDAV)", BASE_WEBDAV + "#METHOD_MKCOL", false, true); @@ -133,7 +140,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.3 MKCOL Method - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method MOVE = new Method( "MOVE", "Logical equivalent of a copy, followed by consistency maintenance processing, followed by a delete of the source (WebDAV)", @@ -185,7 +194,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.1 PROPFIND - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method PROPFIND = new Method( "PROPFIND", "Retrieves properties defined on the resource identified by the request URI", @@ -198,7 +209,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.2 PROPPATCH - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method PROPPATCH = new Method( "PROPPATCH", "Processes instructions specified in the request body to set and/or remove properties defined on the resource identified by the request URI", @@ -237,7 +250,9 @@ public final class Method implements Comparable { * @see WEBDAV * RFC - 8.11 UNLOCK Method - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Method UNLOCK = new Method( "UNLOCK", "Removes the lock identified by the lock token from the request URI, and all other resources included in the lock", diff --git a/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Status.java b/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Status.java index 9b49c7681f..a65611c8e8 100644 --- a/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Status.java +++ b/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/data/Status.java @@ -27,6 +27,7 @@ public final class Status { + Engine.MINOR_NUMBER + "/gwt/api/"; + @Deprecated private static final String BASE_WEBDAV = "http://www.webdav.org/specs/rfc2518.html"; /** @@ -67,7 +68,9 @@ public final class Status { * * @see WEBDAV * RFC - 10.5 424 Failed Dependency - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Status CLIENT_ERROR_FAILED_DEPENDENCY = new Status(424); /** @@ -106,7 +109,9 @@ public final class Status { * * @see WEBDAV * RFC - 10.4 423 Locked - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Status CLIENT_ERROR_LOCKED = new Status(423); /** @@ -241,7 +246,9 @@ public final class Status { * * @see WEBDAV * RFC - 10.3 422 Unprocessable Entity - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Status CLIENT_ERROR_UNPROCESSABLE_ENTITY = new Status( 422); @@ -327,7 +334,9 @@ public final class Status { * * @see WEBDAV * RFC - 10.1 102 Processing - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Status INFO_PROCESSING = new Status(102); /** @@ -462,7 +471,9 @@ public final class Status { * * @see WEBDAV * RFC - 10.6 507 Insufficient Storage - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Status SERVER_ERROR_INSUFFICIENT_STORAGE = new Status( 507); @@ -544,7 +555,9 @@ public final class Status { * * @see WEBDAV * RFC - 10.2 207 Multi-Status - */ + * @deprecated Will be removed in next version. + */ + @Deprecated public static final Status SUCCESS_MULTI_STATUS = new Status(207); /** diff --git a/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/engine/connector/WebDavProtocolHelper.java b/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/engine/connector/WebDavProtocolHelper.java index 6e7d637bbd..13ebce0aaf 100644 --- a/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/engine/connector/WebDavProtocolHelper.java +++ b/org.restlet.gwt/org.restlet.gwt/src/main/java/org/restlet/client/engine/connector/WebDavProtocolHelper.java @@ -15,8 +15,9 @@ * Protocol helper for the WEBDAV protocol. * * @author Thierry Boileau - * + * @deprecated Will be removed in next version. */ +@Deprecated public class WebDavProtocolHelper extends ProtocolHelper { @Override diff --git a/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Method.java b/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Method.java index 3b97c33f3e..7e29d5328f 100644 --- a/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Method.java +++ b/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Method.java @@ -34,6 +34,7 @@ public final class Method implements Comparable { private static final String BASE_HTTP = "http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html"; + @Deprecated private static final String BASE_WEBDAV = "http://www.webdav.org/specs/rfc2518.html"; /** @@ -52,7 +53,9 @@ public final class Method implements Comparable { * * @see WEBDAV * RFC - 8.8 COPY Method + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method COPY = new Method("COPY", "Creates a duplicate of the source resource, identified by the Request-URI, in the destination resource, identified by the URI in the Destination header", BASE_WEBDAV + "#METHOD_COPY", false, true); @@ -99,7 +102,9 @@ public final class Method implements Comparable { * * @see WEBDAV * RFC - 8.10 LOCK Method + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method LOCK = new Method("LOCK", "Used to take out a lock of any access type (WebDAV)", BASE_WEBDAV + "#METHOD_LOCK", false, false); @@ -109,7 +114,9 @@ public final class Method implements Comparable { * * @see WEBDAV * RFC - 8.3 MKCOL Method + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method MKCOL = new Method("MKCOL", "Used to create a new collection (WebDAV)", BASE_WEBDAV + "#METHOD_MKCOL", false, true); @@ -120,7 +127,9 @@ public final class Method implements Comparable { * * @see WEBDAV * RFC - 8.3 MKCOL Method + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method MOVE = new Method("MOVE", "Logical equivalent of a copy, followed by consistency maintenance processing, followed by a delete of the source (WebDAV)", BASE_WEBDAV + "#METHOD_MOVE", false, false); @@ -166,7 +175,9 @@ public final class Method implements Comparable { * @see WEBDAV RFC - * 8.1 PROPFIND + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method PROPFIND = new Method("PROPFIND", "Retrieves properties defined on the resource identified by the request URI", BASE_WEBDAV + "#METHOD_PROPFIND", true, true); @@ -178,7 +189,9 @@ public final class Method implements Comparable { * @see WEBDAV RFC - * 8.2 PROPPATCH + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method PROPPATCH = new Method("PROPPATCH", "Processes instructions specified in the request body to set and/or remove properties defined on the resource identified by the request URI", BASE_WEBDAV + "#METHOD_PROPPATCH", false, true); @@ -210,7 +223,9 @@ public final class Method implements Comparable { * * @see WEBDAV * RFC - 8.11 UNLOCK Method + * @deprecated Will be removed in next version. */ + @Deprecated public static final Method UNLOCK = new Method("UNLOCK", "Removes the lock identified by the lock token from the request URI, and all other resources included in the lock", BASE_WEBDAV + "#METHOD_UNLOCK", false, false); diff --git a/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Status.java b/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Status.java index f73a5c6714..a4965f3833 100644 --- a/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Status.java +++ b/org.restlet.java/org.restlet/src/main/java/org/restlet/data/Status.java @@ -24,6 +24,7 @@ public final class Status { private static final String BASE_RESTLET = "https://javadocs.restlet.talend.com/" + Engine.MAJOR_NUMBER + '.' + Engine.MINOR_NUMBER + "/api/"; + @Deprecated private static final String BASE_WEBDAV = "http://www.webdav.org/specs/rfc2518.html"; /** @@ -62,7 +63,9 @@ public final class Status { * * @see WEBDAV RFC * - 10.5 424 Failed Dependency + * @deprecated Will be removed in next version. */ + @Deprecated public static final Status CLIENT_ERROR_FAILED_DEPENDENCY = new Status(424); /** @@ -100,7 +103,9 @@ public final class Status { * * @see WEBDAV RFC * - 10.4 423 Locked + * @deprecated Will be removed in next version. */ + @Deprecated public static final Status CLIENT_ERROR_LOCKED = new Status(423); /** @@ -229,7 +234,9 @@ public final class Status { * * @see WEBDAV RFC * - 10.3 422 Unprocessable Entity + * @deprecated Will be removed in next version. */ + @Deprecated public static final Status CLIENT_ERROR_UNPROCESSABLE_ENTITY = new Status(422); /** @@ -312,7 +319,9 @@ public final class Status { * * @see WEBDAV RFC * - 10.1 102 Processing + * @deprecated Will be removed in next version. */ + @Deprecated public static final Status INFO_PROCESSING = new Status(102); /** @@ -446,7 +455,9 @@ public final class Status { * * @see WEBDAV RFC * - 10.6 507 Insufficient Storage + * @deprecated Will be removed in next version. */ + @Deprecated public static final Status SERVER_ERROR_INSUFFICIENT_STORAGE = new Status(507); /** @@ -524,7 +535,9 @@ public final class Status { * * @see WEBDAV RFC * - 10.2 207 Multi-Status + * @deprecated Will be removed in next version. */ + @Deprecated public static final Status SUCCESS_MULTI_STATUS = new Status(207); /** diff --git a/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/Engine.java b/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/Engine.java index 4e8e2d1fb2..5cbb8ad96a 100644 --- a/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/Engine.java +++ b/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/Engine.java @@ -784,6 +784,7 @@ public void registerDefaultConverters() { /** * Registers the default protocols. */ + @SuppressWarnings("deprecation") public void registerDefaultProtocols() { getRegisteredProtocols().add(new org.restlet.engine.connector.HttpProtocolHelper()); getRegisteredProtocols().add(new org.restlet.engine.connector.WebDavProtocolHelper()); diff --git a/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/connector/WebDavProtocolHelper.java b/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/connector/WebDavProtocolHelper.java index b0160f535d..6daa6b0aac 100644 --- a/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/connector/WebDavProtocolHelper.java +++ b/org.restlet.java/org.restlet/src/main/java/org/restlet/engine/connector/WebDavProtocolHelper.java @@ -15,7 +15,9 @@ * Protocol helper for the WEBDAV protocol. * * @author Thierry Boileau + * @deprecated Will be removed in next version. */ +@Deprecated public class WebDavProtocolHelper extends ProtocolHelper { @Override