Project

General

Profile

« Previous | Next » 

Revision 5791

Added by berkley almost 14 years ago

fixed bug with http/https port

View differences:

src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
210 210
    private static final String RESOURCE_CHECKSUM = "checksum";
211 211
    private static final String RESOURCE_MONITOR = "monitor";
212 212
    private static final String RESOURCE_BASE_URL = "d1";
213
    private static final String RESOURCE_REPLICATE = "replicate";
213 214

  
214 215
    /*
215 216
     * API Functions used as URL parameters
......
580 581
                        }
581 582
                    }
582 583
                    status = true;
584
                } else if(resource.equals(RESOURCE_REPLICATE)) {
585
                    System.out.println("processing replicate request");
586
                    String pathInfo = request.getPathInfo();
587
                    pathInfo = pathInfo.substring(1);
588
                    System.out.println("pathInfo: " + pathInfo);
589
                    status = true;
583 590
                }
584 591
                    
585 592
                if (!status)
......
658 665
        mnCrud03.addMethod(getServiceMethod("MN_crud.getChecksum()", "/checksum/<guid>", true));
659 666
        mnCrud03.addMethod(getServiceMethod("MN_crud.getLogRecords()", "/log", true));
660 667
        mnReplication03.addMethod(getServiceMethod("MN_replication.listObjects()", "/object", true));
668
        mnReplication03.addMethod(getServiceMethod("MN_replication.replicate()", "/object", true));
661 669
        mnHealth04.addMethod(getServiceMethod("MN_health.ping()", "/health/ping", false));
662 670
        mnHealth04.addMethod(getServiceMethod("MN_health.getObjectStatistics()", "/monitor/object/<guid>", false));
663 671
        mnHealth06.addMethod(getServiceMethod("MN_health.getStatus()", "/health/status", false));
src/edu/ucsb/nceas/metacat/util/SystemUtil.java
154 154
	 * @return string holding the server URL
155 155
	 */
156 156
	public static String getServerURL() throws PropertyNotFoundException {
157
		String ServerURL = "http://" + PropertyService.getProperty("server.name");
158
		String httpPort = PropertyService.getProperty("server.httpPort");
157
	    String httpPort = PropertyService.getProperty("server.httpPort");
158
	    
159
	    String serverURL = "http://";
160
	    if(httpPort.equals("443") || httpPort.equals("8443"))
161
	    {
162
	        serverURL = "https://";
163
	    }
164
	    
165
	    serverURL += PropertyService.getProperty("server.name");
166
		
159 167
		if (!httpPort.equals("80")) {
160
			ServerURL += ":" + httpPort;
168
			serverURL += ":" + httpPort;
161 169
		}
162 170

  
163
		return ServerURL;
171
		return serverURL;
164 172
	}
165 173

  
166 174
	/**

Also available in: Unified diff