Revision 4293 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wcs/WCSClient.java

View differences:

WCSClient.java
40 40
 */
41 41
package org.gvsig.remoteClient.wcs;
42 42

  
43
import java.io.IOException;
44
import java.net.ConnectException;
45

  
43 46
import org.gvsig.remoteClient.wcs.wcs_1_0_0.WCSProtocolHandler1_0_0;
44
import org.gvsig.remoteClient.wms.wms_1_1_1.WMSProtocolHandler1_1_1;
47
import org.gvsig.remoteClient.wms.WMSProtocolHandlerFactory;
45 48

  
46 49

  
47 50
public class WCSClient extends org.gvsig.remoteClient.RasterClient{
......
50 53
    /**
51 54
     * Constructor.
52 55
     * the parameter host, indicates the WCS host to connect.
56
     * @throws IOException 
53 57
     *
54 58
     */
55
    public WCSClient(String host)
59
    public WCSClient(String host) throws IOException
56 60
    {
57
        //m_log = LogManager.getLogManager().getLogger(getClass().getName());
61
       
58 62
        setHost(host);
59
        /*
60
        
61
        The negotiation is performed in the connect method.
62
        try
63
        {
64
            //TODO: implement a correct negotiation algorithm
65
            //handler = WCSProtocolHandlerFactory.negotiate(new URL(host));
66
            handler = new WCSProtocolHandler1_0_0();
67
            handler.setHost(host);
68
        }
69
        catch(Exception e)
70
        {
71
            e.printStackTrace();
63
        try {        	
64
        	handler = WCSProtocolHandlerFactory.negotiate(host);
65
        	handler.setHost(host);        
66
        } catch(ConnectException conE) {
67
        	conE.printStackTrace();
68
        	throw conE; 
69
        } catch(IOException ioE) {
70
        	ioE.printStackTrace();
71
        	throw ioE; 
72
        } catch(Exception e) {
73
        	e.printStackTrace();       	
72 74
        } 
73
        */      
74 75
    }
75 76
    
76 77
    /**
......
81 82
    {
82 83
        try {
83 84
            getCapabilities();
84
            if (handler == null)
85
            {
86
                if (getHost().trim().length() > 0)
87
                {                   
85
            if (handler == null) {
86
                if (getHost().trim().length() > 0) {                   
88 87
                    //TODO: Implement correctly the negotiate algorithm
89 88
                    //handler = WMSProtocolHandlerFactory.negotiate(new URL(getHost()));
90 89
                    handler = new WCSProtocolHandler1_0_0();
91 90
                    handler.setHost(getHost());
92
                }
93
                else
94
                {
91
                } else {
95 92
                    //must to specify host first!!!!
96 93
                    return false;
97 94
                }

Also available in: Unified diff