Clover coverage report - ActiveIO - 1.0 Coverage timestamp: Fri Apr 22 2005 14:27:22 PDT FRAMES NO FRAMES |
file stats: | LOC: | 53 |  | Methods: | 7
| NCLOC: | 26 |  | Classes: | 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
Source file | Conditionals | Statements | Methods | TOTAL
URISupport.java | - | 28.6% | 28.6% | 28.6% |

1 |  |
     /**
2 |  |
      *
3 |  |
      * Copyright 2004 Hiram Chirino
4 |  |
      *
5 |  |
      *  Licensed under the Apache License, Version 2.0 (the "License");
6 |  |
      *  you may not use this file except in compliance with the License.
7 |  |
      *  You may obtain a copy of the License at
8 |  |
      *
9 |  |
      *     http://www.apache.org/licenses/LICENSE-2.0
10 |  |
      *
11 |  |
      *  Unless required by applicable law or agreed to in writing, software
12 |  |
      *  distributed under the License is distributed on an "AS IS" BASIS,
13 |  |
      *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 |  |
      *  See the License for the specific language governing permissions and
15 |  |
      *  limitations under the License.
16 |  |
      */
17 |  |
     package org.activeio.net;
18 |  |
19 |  |
     import java.net.URI;
20 |  |
     import java.net.URISyntaxException;
21 |  |
22 |  |
     /**
23 |  |
      * The URISupport class provides a few static methods that provides a few usefull
24 |  |
      * operations to manipulate URIs.
25 |  |
      *
26 |  |
      * @version $Revision$
27 |  |
      */
28 |  |
     public class URISupport {
29 |  |
30 | 64 |
         static public URI changePort(URI bindAddr, int port) throws URISyntaxException {
31 | 64 |
             return new URI(bindAddr.getScheme(), bindAddr.getUserInfo(), bindAddr.getHost(), port, bindAddr.getPath(), bindAddr.getQuery(), bindAddr.getFragment());
32 |  |
         }
33 | 0 |
         static public URI changeScheme(URI bindAddr, String scheme) throws URISyntaxException {
34 | 0 |
             return new URI(scheme, bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr.getPath(), bindAddr.getQuery(), bindAddr.getFragment());
35 |  |
         }
36 | 0 |
         static public URI changeUserInfo(URI bindAddr, String userInfo) throws URISyntaxException {
37 | 0 |
             return new URI(bindAddr.getScheme(), userInfo, bindAddr.getHost(), bindAddr.getPort(), bindAddr.getPath(), bindAddr.getQuery(), bindAddr.getFragment());
38 |  |
         }
39 | 64 |
         static public URI changeHost(URI bindAddr, String host) throws URISyntaxException {
40 | 64 |
             return new URI(bindAddr.getScheme(), bindAddr.getUserInfo(), host, bindAddr.getPort(), bindAddr.getPath(), bindAddr.getQuery(), bindAddr.getFragment());
41 |  |
         }
42 | 0 |
         static public URI changePath(URI bindAddr, String path) throws URISyntaxException {
43 | 0 |
             return new URI(bindAddr.getScheme(), bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), path, bindAddr.getQuery(), bindAddr.getFragment());
44 |  |
         }
45 | 0 |
         static public URI changeQuery(URI bindAddr, String query) throws URISyntaxException {
46 | 0 |
             return new URI(bindAddr.getScheme(), bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr.getPath(), query, bindAddr.getFragment());
47 |  |
         }
48 | 0 |
         static public URI changeFragment(URI bindAddr, String fragment) throws URISyntaxException {
49 | 0 |
             return new URI(bindAddr.getScheme(), bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr.getPath(), bindAddr.getQuery(), fragment);
50 |  |
         }
51 |  |
52 |  |
     }
53 |  |