Skip to content

Commit 7bd6df5

Browse files
authored
Merge pull request #1428 from restlet/2.5-deprecations-removal
Removed deprecated code
2 parents 37d5d73 + 02a8ce3 commit 7bd6df5

File tree

15 files changed

+833
-2090
lines changed

15 files changed

+833
-2090
lines changed

changes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Changes log
2020
- Removed incubator to rely instead on pull requests.
2121
- Renamed extension Inject into Guice as it isn't truly generic.
2222
- Updated the links in all Javadocs file for accuracy.
23+
- Removed code deprecated in version 2.4, including native Restlet XML configuration mechasism.
24+
Please use Spring for an alternative approach if needed.
2325

2426
- 2.5 Milestone 1 (03/09/2020)
2527
- Bugs fixed

org.restlet.java/org.restlet.ext.gae/src/main/java/org/restlet/ext/gae/GaeEnroler.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ public class GaeEnroler implements Enroler {
2727
/** The Administrator role. */
2828
private Role adminRole;
2929

30-
/**
31-
* Default constructor. It defines an administrator role, which name is
32-
* "admin".
33-
*/
34-
public GaeEnroler() {
35-
this("admin", "Administrator of the current application.");
36-
}
37-
3830
/**
3931
* Constructor.
4032
*
@@ -73,32 +65,6 @@ public GaeEnroler(Role adminRole) {
7365
setAdminRole(adminRole);
7466
}
7567

76-
/**
77-
* Constructor.
78-
*
79-
* @param adminRoleName
80-
* The name of the administrator role.
81-
* @deprecated Use {@link #GaeEnroler(Application, String)} instead.
82-
*/
83-
@Deprecated
84-
public GaeEnroler(String adminRoleName) {
85-
this(adminRoleName, "Administrator of the current application.");
86-
}
87-
88-
/**
89-
* Constructor.
90-
*
91-
* @param adminRoleName
92-
* The name of the administrator role.
93-
* @param adminRoleDescription
94-
* The description of the administrator role.
95-
* @deprecated Use {@link #GaeEnroler(Application, String, String)} instead.
96-
*/
97-
@Deprecated
98-
public GaeEnroler(String adminRoleName, String adminRoleDescription) {
99-
this(new Role(adminRoleName, adminRoleDescription));
100-
}
101-
10268
/**
10369
* Adds admin role object if user is an administrator according to Google
10470
* App Engine UserService.

org.restlet.java/org.restlet.ext.gwt/src/main/java/org/restlet/ext/gwt/package.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<HTML>
22
<BODY>
3-
Server-side integration with GWT @minor-version@.
3+
Server-side integration with GWT.
44

55
@since Restlet 1.1
66
@see <a href="@home-uri@">Google Web Toolkit</a>

org.restlet.java/org.restlet.ext.servlet/src/main/java/org/restlet/ext/servlet/ServerServlet.java

Lines changed: 751 additions & 901 deletions
Large diffs are not rendered by default.

org.restlet.java/org.restlet.ext.servlet/src/main/java/org/restlet/ext/servlet/package.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<HTML>
22
<BODY>
3-
Integration with Servlet API @minor-version@. Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems.
3+
Integration with Servlet API. Java Servlet technology provides Web developers with a simple,
4+
consistent mechanism for extending the functionality of a Web server and for accessing existing business systems.
45

56
@since Restlet 1.0
67
@see <a href="https://docs.oracle.com/javaee/7/tutorial/servlets.htm">Servlet HTTP server</a>

org.restlet.java/org.restlet/src/main/java/org/restlet/Application.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,6 @@ public StatusService getStatusService() {
337337
return getServices().get(StatusService.class);
338338
}
339339

340-
/**
341-
* Returns a task service to run concurrent tasks. The service is enabled by
342-
* default.
343-
*
344-
* @return A task service.
345-
* @deprecated
346-
*/
347-
@Deprecated
348-
public org.restlet.service.TaskService getTaskService() {
349-
return getServices().get(org.restlet.service.TaskService.class);
350-
}
351-
352340
/**
353341
* Returns the tunnel service. The service is enabled by default.
354342
*

org.restlet.java/org.restlet/src/main/java/org/restlet/Component.java

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@
99

1010
package org.restlet;
1111

12-
import java.io.File;
13-
import java.net.URI;
1412
import java.util.List;
1513
import java.util.concurrent.CopyOnWriteArrayList;
16-
import java.util.logging.Level;
1714

18-
import org.restlet.data.Reference;
1915
import org.restlet.engine.Engine;
2016
import org.restlet.engine.component.ComponentHelper;
2117
import org.restlet.engine.component.InternalRouter;
22-
import org.restlet.representation.Representation;
23-
import org.restlet.resource.ClientResource;
2418
import org.restlet.routing.Router;
2519
import org.restlet.routing.VirtualHost;
2620
import org.restlet.security.Realm;
@@ -43,38 +37,6 @@
4337
* that provides a transformation of data via its interface." Roy T.
4438
* Fielding<br>
4539
* <br>
46-
* The configuration of a Component can be done programmatically or by using a
47-
* XML document. There are dedicated constructors that accept either an URI
48-
* reference to such XML document or a representation of such XML document,
49-
* allowing easy configuration of the list of supported client and server
50-
* connectors as well as services. In addition, you can add and configure
51-
* virtual hosts (including the default one). Finally, you can attach
52-
* applications either using their fully qualified class name or by pointing to
53-
* a descriptor document (at this time only WADL description are supported, see
54-
* the WADL Restlet extension for details).<br>
55-
* <br>
56-
* The XML Schema of the configuration files is available inside the API JAR
57-
* under the "org.restlet.Component.xsd" name. Here is a sample of XML
58-
* configuration:
59-
*
60-
* <pre>
61-
* &lt;?xml version=&quot;1.0&quot;?&gt;
62-
* &lt;component xmlns=&quot;http://restlet.org/schemas/2.0/Component&quot;&gt;
63-
* &lt;client protocol=&quot;CLAP&quot; /&gt;
64-
* &lt;client protocol=&quot;FILE&quot; /&gt;
65-
* &lt;client protocols=&quot;HTTP HTTPS&quot; /&gt;
66-
* &lt;server protocols=&quot;HTTP HTTPS&quot; /&gt;
67-
*
68-
* &lt;defaultHost&gt;
69-
* &lt;attach uriPattern=&quot;/abcd/{xyz}&quot;
70-
* targetClass=&quot;org.restlet.test.MyApplication&quot; /&gt;
71-
* &lt;attach uriPattern=&quot;/efgh/{xyz}&quot;
72-
* targetDescriptor=&quot;clap://class/org/restlet/test/MyApplication.wadl&quot; /&gt;
73-
* &lt;/defaultHost&gt;
74-
* &lt;/component&gt;
75-
* </pre>
76-
*
77-
* <br>
7840
* Components also have useful services associated. They are all enabled by
7941
* default and are available as properties that can be eventually overridden:
8042
* <ul>
@@ -96,32 +58,6 @@
9658
*/
9759
public class Component extends Restlet {
9860

99-
/**
100-
* Used as bootstrap for configuring and running a component in command line.
101-
* Just provide as first and unique parameter the URI to the XML file. Note that
102-
* relative paths are accepted.
103-
*
104-
* @param args The list of in-line parameters.
105-
* @deprecated Use XML support in the Spring extension instead.
106-
*/
107-
@Deprecated
108-
public static void main(String[] args) throws Exception {
109-
try {
110-
if ((args == null) || (args.length != 1)) {
111-
// Display program arguments
112-
System.err.println("Can't launch the component. Requires the path to an XML configuration file.\n");
113-
} else {
114-
// Create and start the component
115-
URI currentDirURI = (new File(".")).toURI();
116-
URI confURI = currentDirURI.resolve(args[0]);
117-
new Component(confURI.toString()).start();
118-
}
119-
} catch (Exception e) {
120-
System.err.println("Can't launch the component.\nAn unexpected exception occurred:");
121-
e.printStackTrace(System.err);
122-
}
123-
}
124-
12561
/** The modifiable list of client connectors. */
12662
private final ClientList clients;
12763

@@ -177,61 +113,6 @@ public Component() {
177113
}
178114
}
179115

180-
/**
181-
* Constructor with the reference to the XML configuration file.
182-
*
183-
* @param xmlConfigRef The URI reference to the XML configuration file.
184-
* @deprecated Use XML support in the Spring extension instead.
185-
*/
186-
@Deprecated
187-
public Component(Reference xmlConfigRef) {
188-
this();
189-
190-
// Get the representation of the configuration file.
191-
Representation xmlConfigRepresentation = null;
192-
193-
if (xmlConfigRef != null) {
194-
ClientResource cr = new ClientResource(xmlConfigRef);
195-
xmlConfigRepresentation = cr.get();
196-
197-
if (xmlConfigRepresentation != null) {
198-
new org.restlet.engine.component.ComponentXmlParser(this, xmlConfigRepresentation).parse();
199-
} else {
200-
getLogger().log(Level.WARNING,
201-
"Unable to get the Component XML configuration located at this URI: " + xmlConfigRef);
202-
}
203-
}
204-
}
205-
206-
/**
207-
* Constructor with the representation of the XML configuration file.
208-
*
209-
* @param xmlConfigRepresentation The representation of the XML configuration
210-
* file.
211-
* @deprecated Use XML support in the Spring extension instead.
212-
*/
213-
@Deprecated
214-
public Component(Representation xmlConfigRepresentation) {
215-
this();
216-
217-
if (xmlConfigRepresentation != null) {
218-
new org.restlet.engine.component.ComponentXmlParser(this, xmlConfigRepresentation).parse();
219-
} else {
220-
getLogger().log(Level.WARNING, "Unable to parse the Component XML configuration.");
221-
}
222-
}
223-
224-
/**
225-
* Constructor with the URI reference to the XML configuration file.
226-
*
227-
* @param xmlConfigurationRef The URI reference to the XML configuration file.
228-
* @deprecated Use XML support in the Spring extension instead.
229-
*/
230-
@Deprecated
231-
public Component(String xmlConfigurationRef) {
232-
this((xmlConfigurationRef == null) ? null : new Reference(xmlConfigurationRef));
233-
}
234-
235116
/**
236117
* Returns a modifiable list of client connectors.
237118
*

org.restlet.java/org.restlet/src/main/java/org/restlet/data/MediaType.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,6 @@ public final class MediaType extends Metadata {
256256
public static final MediaType APPLICATION_RDF_TRIX = register("application/trix",
257257
"Simple XML serialized Resource Description Framework document");
258258

259-
/**
260-
* @deprecated Replaced by the official {@link #TEXT_TURTLE} media type.
261-
*/
262-
@Deprecated
263-
public static final MediaType APPLICATION_RDF_TURTLE = register("application/x-turtle",
264-
"Plain text serialized Resource Description Framework document");
265-
266259
public static final MediaType APPLICATION_RDF_XML = register("application/rdf+xml",
267260
"Normalized XML serialized Resource Description Framework document");
268261

org.restlet.java/org.restlet/src/main/java/org/restlet/engine/adapter/HttpRequest.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.util.logging.Level;
2323

2424
import org.restlet.Context;
25-
import org.restlet.Message;
2625
import org.restlet.Request;
2726
import org.restlet.data.CacheDirective;
2827
import org.restlet.data.ChallengeResponse;
@@ -60,19 +59,6 @@
6059
* @author Jerome Louvel
6160
*/
6261
public class HttpRequest extends Request {
63-
/**
64-
* Adds a new header to the given request.
65-
*
66-
* @param request The request to update.
67-
* @param headerName The header name to add.
68-
* @param headerValue The header value to add.
69-
* @deprecated Use {@link Message#getHeaders()} directly instead.
70-
*/
71-
@Deprecated
72-
public static void addHeader(Request request, String headerName, String headerValue) {
73-
request.getHeaders().add(new Header(headerName, headerValue));
74-
}
75-
7662
/**
7763
* Indicates if the access control data for request headers was parsed and added
7864
*/

0 commit comments

Comments
 (0)