Package: CDOURIData

CDOURIData

nameinstructionbranchcomplexitylinemethod
CDOURIData(String, String, String)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getRepository()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getResource()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getServer()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
parse(URI)
M: 0 C: 49
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 9
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2013 RCP Vision (http://www.rcp-vision.com) and others.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * Lorenzo Bettini - initial API and implementation
10: *******************************************************************************/
11:
12: package org.eclipse.emf.parsley.cdo.util;
13:
14: import org.eclipse.emf.common.util.URI;
15:
16: /**
17: * @author Lorenzo Bettini
18: *
19: */
20: public class CDOURIData {
21:
22:         private String server;
23:
24:         private String repository;
25:
26:         private String resource;
27:
28:         public CDOURIData(String host, String sessionName, String resourceName) {
29:                 super();
30:                 this.server = host;
31:                 this.repository = sessionName;
32:                 this.resource = resourceName;
33:         }
34:
35:         public String getServer() {
36:                 return server;
37:         }
38:
39:         public String getRepository() {
40:                 return repository;
41:         }
42:
43:         public String getResource() {
44:                 return resource;
45:         }
46:
47:         public static CDOURIData parse(URI uri) {
48:                 String server = uri.authority();
49:•                if (server == null) {
50:                         throw new IllegalArgumentException("missing server in URI: " + uri);
51:                 }
52:                 String scheme = uri.scheme();
53:•                if (!"cdo".equals(scheme)) {
54:                         throw new IllegalArgumentException("not a cdo scheme: " + uri);
55:                 }
56:                 String repository = uri.segment(0);
57:                 String resource = uri.segment(1);
58:                 return new CDOURIData(server, repository, resource);
59:         }
60: }