Skip to content

Commit

Permalink
Sweeping under the rug a bit of deprecatd org.vfny stuff, unfortunate…
Browse files Browse the repository at this point in the history
…ly the package is not deprecated as a whole, but we should remove it
  • Loading branch information
aaime committed Jun 1, 2019
1 parent d44490c commit bd7ad84
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 41 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import org.geoserver.ows.util.OwsUtils; import org.geoserver.ows.util.OwsUtils;
import org.geoserver.platform.Operation; import org.geoserver.platform.Operation;
import org.geoserver.platform.ServiceException; import org.geoserver.platform.ServiceException;
import org.vfny.geoserver.Request;
import org.vfny.geoserver.Response;


/** /**
* Wraps an old style {@link Response} in a new {@link org.geoserver.ows.Response}. * Wraps an old style {@link Response} in a new {@link org.geoserver.ows.Response}.
Expand All @@ -25,6 +23,7 @@
* *
* @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
*/ */
@SuppressWarnings("deprecation")
public class ResponseAdapter extends org.geoserver.ows.Response { public class ResponseAdapter extends org.geoserver.ows.Response {
GeoServer gs; GeoServer gs;


Expand All @@ -36,10 +35,13 @@ public ResponseAdapter(Class delegateClass, GeoServer gs) {


public String getMimeType(Object value, Operation operation) throws ServiceException { public String getMimeType(Object value, Operation operation) throws ServiceException {
// get the delegate // get the delegate
Response delegate = (Response) value; org.vfny.geoserver.Response delegate = (org.vfny.geoserver.Response) value;


// get the requst object from the operation // get the requst object from the operation
Request request = (Request) OwsUtils.parameter(operation.getParameters(), Request.class); org.vfny.geoserver.Request request =
(org.vfny.geoserver.Request)
OwsUtils.parameter(
operation.getParameters(), org.vfny.geoserver.Request.class);


// the old contract specifies that execute must be called before // the old contract specifies that execute must be called before
// get content type // get content type
Expand All @@ -52,14 +54,14 @@ public String getMimeType(Object value, Operation operation) throws ServiceExcep
public void write(Object value, OutputStream output, Operation operation) public void write(Object value, OutputStream output, Operation operation)
throws IOException, ServiceException { throws IOException, ServiceException {
// get the delegate // get the delegate
Response delegate = (Response) value; org.vfny.geoserver.Response delegate = (org.vfny.geoserver.Response) value;


// write the response // write the response
delegate.writeTo(output); delegate.writeTo(output);
} }


public String[][] getHeaders(Object value, Operation operation) throws ServiceException { public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
Response delegate = (Response) value; org.vfny.geoserver.Response delegate = (org.vfny.geoserver.Response) value;
HashMap map = new HashMap(); HashMap map = new HashMap();
if (delegate.getContentDisposition() != null) { if (delegate.getContentDisposition() != null) {
map.put("Content-Disposition", delegate.getContentDisposition()); map.put("Content-Disposition", delegate.getContentDisposition());
Expand Down
29 changes: 0 additions & 29 deletions src/main/src/main/java/org/vfny/geoserver/ExceptionHandler.java

This file was deleted.

1 change: 1 addition & 0 deletions src/main/src/main/java/org/vfny/geoserver/Response.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
* @version $Id$ * @version $Id$
* @deprecated implement {@link org.geoserver.ows.Response} instead * @deprecated implement {@link org.geoserver.ows.Response} instead
*/ */
@SuppressWarnings("deprecation")
public interface Response { public interface Response {
/** /**
* Excecutes a request. If this method finalizes without throwing an Exception, the Response * Excecutes a request. If this method finalizes without throwing an Exception, the Response
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.opengis.filter.FilterFactory; import org.opengis.filter.FilterFactory;
import org.opengis.filter.Id; import org.opengis.filter.Id;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.vfny.geoserver.Request;
import org.vfny.geoserver.util.requests.FilterHandlerImpl; import org.vfny.geoserver.util.requests.FilterHandlerImpl;
import org.xml.sax.EntityResolver; import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
Expand All @@ -64,6 +63,7 @@
* @author Gabriel Roldan * @author Gabriel Roldan
* @version $Id$ * @version $Id$
*/ */
@SuppressWarnings("deprecation")
public abstract class KvpRequestReader implements ApplicationContextAware { public abstract class KvpRequestReader implements ApplicationContextAware {
/** Class logger */ /** Class logger */
private static Logger LOGGER = private static Logger LOGGER =
Expand Down Expand Up @@ -122,7 +122,8 @@ protected boolean keyExists(String key) {
* returns the propper Request subclass for the set of parameters it was setted up and the kind * returns the propper Request subclass for the set of parameters it was setted up and the kind
* of request it is specialized for * of request it is specialized for
*/ */
public abstract Request getRequest(HttpServletRequest request) throws ServiceException; public abstract org.vfny.geoserver.Request getRequest(HttpServletRequest request)
throws ServiceException;


/** /**
* Attempts to parse out the proper typeNames from the FeatureId filters. It simply uses the * Attempts to parse out the proper typeNames from the FeatureId filters. It simply uses the
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.geoserver.config.ServiceInfo; import org.geoserver.config.ServiceInfo;
import org.geoserver.platform.ServiceException; import org.geoserver.platform.ServiceException;
import org.vfny.geoserver.Request;


/** /**
* This utility reads in XML requests and returns them as appropriate request objects. * This utility reads in XML requests and returns them as appropriate request objects.
Expand All @@ -20,6 +19,7 @@
* @author Gabriel Rold?n * @author Gabriel Rold?n
* @version $Id$ * @version $Id$
*/ */
@SuppressWarnings("deprecation")
public abstract class XmlRequestReader { public abstract class XmlRequestReader {
/** Class logger */ /** Class logger */
protected static Logger LOGGER = protected static Logger LOGGER =
Expand All @@ -29,7 +29,8 @@ public abstract class XmlRequestReader {
private ServiceInfo serviceConfig; private ServiceInfo serviceConfig;


/** */ /** */
public abstract Request read(Reader reader, HttpServletRequest req) throws ServiceException; public abstract org.vfny.geoserver.Request read(Reader reader, HttpServletRequest req)
throws ServiceException;


/** /**
* This will create a new XmlRequestReader * This will create a new XmlRequestReader
Expand Down
2 changes: 0 additions & 2 deletions src/wms/src/test/java/org/geoserver/wms/GetMapTest.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.geoserver.wms.WMSMockData.DummyRasterMapProducer; import org.geoserver.wms.WMSMockData.DummyRasterMapProducer;
import org.geotools.factory.CommonFactoryFinder; import org.geotools.factory.CommonFactoryFinder;
import org.geotools.filter.function.EnvFunction; import org.geotools.filter.function.EnvFunction;
import org.geotools.ows.wms.response.GetMapResponse;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.Envelope;
Expand Down Expand Up @@ -49,7 +48,6 @@ public void setUp() throws Exception {
getMapOp = new GetMap(mockData.getWMS()); getMapOp = new GetMap(mockData.getWMS());
} }


/** Test method for {@link GetMapResponse#execute(org.vfny.geoserver.Request)}. */
@Test @Test
public void testExecuteNoExtent() { public void testExecuteNoExtent() {
request.setBbox(null); request.setBbox(null);
Expand Down

0 comments on commit bd7ad84

Please sign in to comment.