diff --git a/model/basic-model/pom.xml b/model/basic-model/pom.xml
index 807389b..66ed4c5 100644
--- a/model/basic-model/pom.xml
+++ b/model/basic-model/pom.xml
@@ -33,6 +33,10 @@
     <description>Basic Models used and model handling in Apex</description>
 
     <dependencies>
+         <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.apex-pdp.model</groupId>
             <artifactId>utilities</artifactId>
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
index b19255a..6ca9c03 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
@@ -43,8 +43,8 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.utilities.Assertions;
-import org.onap.policy.apex.model.utilities.ResourceUtils;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
+import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
@@ -119,7 +119,7 @@
         if (schemaFileName != null) {
             try {
                 // Set the concept schema
-                final URL schemaURL = ResourceUtils.getURLResource(schemaFileName);
+                final URL schemaURL = ResourceUtils.getUrlResource(schemaFileName);
                 final Schema apexConceptSchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaURL);
                 unmarshaller.setSchema(apexConceptSchema);
             }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java
index 04b6420..356afd7 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java
@@ -34,7 +34,7 @@
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
-import org.onap.policy.apex.model.utilities.ResourceUtils;
+import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
diff --git a/model/model-api/pom.xml b/model/model-api/pom.xml
index 53ecd65..0fe2b84 100644
--- a/model/model-api/pom.xml
+++ b/model/model-api/pom.xml
@@ -32,6 +32,10 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+        </dependency>
+        <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>policy-model</artifactId>
             <version>${project.version}</version>
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
index 89a656a..b422d84 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
@@ -55,8 +55,8 @@
 import org.onap.policy.apex.model.policymodel.handling.PolicyModelMerger;
 import org.onap.policy.apex.model.policymodel.handling.PolicyModelSplitter;
 import org.onap.policy.apex.model.utilities.Assertions;
-import org.onap.policy.apex.model.utilities.ResourceUtils;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
+import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
diff --git a/model/policy-model/pom.xml b/model/policy-model/pom.xml
index e293499..97e4abc 100644
--- a/model/policy-model/pom.xml
+++ b/model/policy-model/pom.xml
@@ -31,6 +31,10 @@
     <description>Policy Models used in Apex</description>
 
     <dependencies>
+         <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.apex-pdp.model</groupId>
             <artifactId>context-model</artifactId>
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyLogicReader.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyLogicReader.java
index 3e55712..822a803 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyLogicReader.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyLogicReader.java
@@ -24,7 +24,7 @@
 import org.onap.policy.apex.model.policymodel.concepts.AxLogic;
 import org.onap.policy.apex.model.policymodel.concepts.AxLogicReader;
 import org.onap.policy.apex.model.policymodel.concepts.PolicyRuntimeException;
-import org.onap.policy.apex.model.utilities.ResourceUtils;
+import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
diff --git a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/PropertyUtils.java b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/PropertyUtils.java
deleted file mode 100644
index 72f8563..0000000
--- a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/PropertyUtils.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.model.utilities;
-
-import java.util.Map.Entry;
-
-/**
- * Convenience methods for handling Java properties class instances.
- *
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
-public abstract class PropertyUtils {
-    /**
-     * Private constructor used to prevent sub class instantiation.
-     */
-    private PropertyUtils() {
-    }
-
-    /**
-     * Return all properties as a string.
-     *
-     * @return a string containing all the property values
-     */
-    public static String getAllProperties() {
-        final StringBuilder builder = new StringBuilder();
-
-        for (final Entry<Object, Object> property : System.getProperties().entrySet()) {
-            builder.append(property.getKey().toString());
-            builder.append('=');
-            builder.append(property.getValue().toString());
-            builder.append('\n');
-        }
-
-        return builder.toString();
-    }
-
-    /**
-     * Checks if a property is set. If the property is set with no value or with a value of "true", this method returns true. It returns "false" if the property
-     * is not set or is set to false
-     *
-     * @param propertyName The property to check
-     * @return true if the property is set to true, false otherwise
-     */
-    public static boolean propertySetOrTrue(final String propertyName) {
-        if (propertyName == null) {
-            return false;
-        }
-
-        final String propertyValue = System.getProperty(propertyName);
-        if (propertyValue == null) {
-            return false;
-        }
-
-        if (propertyValue.trim().length() == 0) {
-            return true;
-        }
-
-        return new Boolean(propertyValue);
-    }
-}
diff --git a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/ResourceUtils.java b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/ResourceUtils.java
deleted file mode 100644
index 588748d..0000000
--- a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/ResourceUtils.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.model.utilities;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
-
-/**
- * This is common utility class with static methods for handling Java resources on the class path. It is an abstract class to prevent any direct instantiation
- * and private constructor to prevent extending this class.
- *
- * @author Sajeevan Achuthan (sajeevan.achuthan@ericsson.com)
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
-public abstract class ResourceUtils {
-    // Get a reference to the logger
-    private static final XLogger LOGGER = XLoggerFactory.getXLogger(ResourceUtils.class);
-
-    // The length of byte buffers used to read resources into strings
-    private static final int BYTE_BUFFER_LENGH = 1024;
-
-    /**
-     * Private constructor used to prevent sub class instantiation.
-     */
-    private ResourceUtils() {
-    }
-
-    /**
-     * Method to resolve a resource; the local file system is checked first and then the class path is checked.
-     *
-     * @param resourceName The resource name
-     * @return A URL to a resource
-     */
-    public static URL getURL4Resource(final String resourceName) {
-        // Check the local fine system first
-        final URL urlToResource = getLocalFile(resourceName);
-
-        // Check if this is a local file
-        if (urlToResource != null) {
-            return urlToResource;
-        }
-        else {
-            // Resort to the class path
-            return getURLResource(resourceName);
-        }
-    }
-
-    /**
-     * Method to return a resource as a string. The resource can be on the local file system or in the class path. The resource is resolved and loaded into a
-     * string.
-     *
-     * @param resourceName The resource name
-     * @return A string containing the resource
-     */
-    public static String getResourceAsString(final String resourceName) {
-        // Get the resource as a stream, we'll convert it to a string then
-        final InputStream resourceStream = getResourceAsStream(resourceName);
-        if (resourceStream == null) {
-            return null;
-        }
-
-        // Read the stream contents in to an output stream
-        final ByteArrayOutputStream resourceOutputStreamBuffer = new ByteArrayOutputStream();
-        final byte[] resourceBuffer = new byte[BYTE_BUFFER_LENGH];
-        int length;
-        try {
-            while ((length = resourceStream.read(resourceBuffer)) != -1) {
-                resourceOutputStreamBuffer.write(resourceBuffer, 0, length);
-            }
-        }
-        catch (final IOException e) {
-            LOGGER.debug("error reading resource stream \"{}\" : " + e.getMessage(), resourceName, e);
-            return null;
-        }
-
-        return resourceOutputStreamBuffer.toString();
-    }
-
-    /**
-     * Method to return a resource as a stream. The resource can be on the local file system or in the class path. The resource is resolved and returned as a
-     * stream.
-     *
-     * @param resourceName The resource name
-     * @return A stream attached to the resource
-     */
-    public static InputStream getResourceAsStream(final String resourceName) {
-        // Find a URL to the resource first
-        final URL urlToResource = getURL4Resource(resourceName);
-
-        // Check if the resource exists
-        if (urlToResource == null) {
-            // No resource found
-            LOGGER.debug("cound not find resource \"{}\" : ", resourceName);
-            return null;
-        }
-
-        // Read the resource into a string
-        try {
-            return urlToResource.openStream();
-        }
-        catch (final IOException e) {
-            // Any of many IO exceptions such as the resource is a directory
-            LOGGER.debug("error attaching resource \"{}\" to stream : " + e.getMessage(), resourceName, e);
-            return null;
-        }
-    }
-
-    /**
-     * Method to get a URL resource from the class path.
-     *
-     * @param resourceName The resource name
-     * @return The URL to the resource
-     */
-    public static URL getURLResource(final String resourceName) {
-        try {
-            final ClassLoader classLoader = ResourceUtils.class.getClassLoader();
-
-            final String[] fileParts = resourceName.split("/");
-            // Read the resource
-            URL url = classLoader.getResource(resourceName);
-
-            // Check if the resource is defined
-            if (url != null) {
-                // Return the resource as a file name
-                LOGGER.debug("found URL resource \"{}\" : ", url);
-                return url;
-            }
-            else {
-                url = classLoader.getResource(fileParts[fileParts.length - 1]);
-                if (url == null) {
-                    LOGGER.debug("cound not find URL resource \"{}\" : ", resourceName);
-                    return null;
-                }
-                LOGGER.debug("found URL resource \"{}\" : ", url);
-                return url;
-            }
-        }
-        catch (final Exception e) {
-            LOGGER.debug("error getting URL resource \"{}\" : " + e.getMessage(), e);
-            return null;
-        }
-    }
-
-    /**
-     * Method to get a URL resource from the local machine.
-     *
-     * @param resourceName The resource name
-     * @return The URL to the resource
-     */
-    public static URL getLocalFile(final String resourceName) {
-        try {
-            // Input might already be in URL format
-            final URL ret = new URL(resourceName);
-            final File f = new File(ret.toURI());
-            if (f.exists()) {
-                return ret;
-            }
-        }
-        catch (final Exception ignore) {
-        		// We ignore exceptions here and catch them below
-        }
-
-        try {
-            final File f = new File(resourceName);
-            // Check if the file exists
-            if (f.exists()) {
-                final URL urlret = f.toURI().toURL();
-                LOGGER.debug("resource \"{}\" was found on the local file system", f.toURI().toURL());
-                return urlret;
-            }
-            else {
-                LOGGER.debug("resource \"{}\" does not exist on the local file system", resourceName);
-                return null;
-            }
-        }
-        catch (final Exception e) {
-            LOGGER.debug("error finding resource \"{}\" : " + e.getMessage(), e);
-            return null;
-        }
-    }
-
-    /**
-     * Gets the file path for a resource on the local file system or on the class path.
-     *
-     * @param resource the resource to the get the file path for
-     * @return the resource file path
-     */
-    public static String getFilePath4Resource(final String resource) {
-        if (resource == null) {
-            return null;
-        }
-
-        URL modelFileURL = getURL4Resource(resource);
-        if (modelFileURL != null) {
-            return modelFileURL.getPath();
-        }
-        else {
-            return resource;
-        }
-    }
-
-}
diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/PropertyUtilsTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/PropertyUtilsTest.java
deleted file mode 100644
index e25e3ff..0000000
--- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/PropertyUtilsTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.model.utilities;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-import org.onap.policy.apex.model.utilities.PropertyUtils;
-
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
-public class PropertyUtilsTest {
-
-    @Test
-    public void test() {
-        System.setProperty("boolean.true", "true");
-        System.setProperty("boolean.false", "false");
-        System.setProperty("boolean.blank", " ");
-        
-        assertNotNull(PropertyUtils.getAllProperties());
-        
-        assertEquals(false, PropertyUtils.propertySetOrTrue(null));
-        assertEquals(false, PropertyUtils.propertySetOrTrue("ZOOBY"));
-        assertEquals(true,  PropertyUtils.propertySetOrTrue("boolean.true"));
-        assertEquals(true,  PropertyUtils.propertySetOrTrue("boolean.blank"));
-        assertEquals(false, PropertyUtils.propertySetOrTrue("boolean.false"));
-    }
-}
diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/ResourceUtilsTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/ResourceUtilsTest.java
deleted file mode 100644
index 9f78906..0000000
--- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/ResourceUtilsTest.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.model.utilities;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.policy.apex.model.utilities.ResourceUtils;
-
-/**
- * The Class ResourceUtilsTest.
- *
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
-public class ResourceUtilsTest {
-    private File tmpDir = null;
-    private File tmpEmptyFile = null;
-    private File tmpUsedFile = null;
-
-    private String jarDirResource = null;
-    private String jarFileResource = null;
-
-    private final String pathDirResource = "testdir";
-    private final String pathFileResource = "testdir/testfile.xml";
-
-    private final String nonExistantResource = "somewhere/over/the/rainbow";
-    private final String invalidResource = "@%%%\\\\_:::DESD";
-
-    /**
-     * Setup resource utils test.
-     *
-     * @throws IOException Signals that an I/O exception has occurred.
-     */
-    @Before
-    public void setupResourceUtilsTest() throws IOException {
-        tmpDir = new File(System.getProperty("java.io.tmpdir"));
-        tmpEmptyFile = File.createTempFile(this.getClass().getName(), ".tmp");
-        tmpUsedFile = File.createTempFile(this.getClass().getName(), ".tmp");
-
-        jarDirResource = "META-INF";
-        jarFileResource = "META-INF/MANIFEST.MF";
-
-        final FileWriter fileWriter = new FileWriter(tmpUsedFile);
-        fileWriter.write("Bluebirds fly over the rainbow");
-        fileWriter.close();
-    }
-
-    /**
-     * Test get url resource.
-     */
-    @Test
-    public void testGetURLResource() {
-        URL theURL = ResourceUtils.getURLResource(tmpDir.getAbsolutePath());
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(tmpEmptyFile.getAbsolutePath());
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(tmpUsedFile.getAbsolutePath());
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(jarDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(jarFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(pathDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(pathFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURLResource("file:///" + pathDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile("src/test/resources/" + pathDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile("src/test/resources/" + pathFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(nonExistantResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(invalidResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getURLResource(null);
-        assertNull(theURL);
-    }
-
-    /**
-     * Test get local file.
-     */
-    @Test
-    public void testGetLocalFile() {
-        URL theURL = ResourceUtils.getLocalFile(tmpDir.getAbsolutePath());
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(tmpEmptyFile.getAbsolutePath());
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(tmpUsedFile.getAbsolutePath());
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(jarDirResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(jarFileResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(pathDirResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(pathFileResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile("src/test/resources/" + pathDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile("src/test/resources/" + pathFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(nonExistantResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile(invalidResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getLocalFile("file:///");
-        assertNotNull(theURL);
-        
-        theURL = ResourceUtils.getLocalFile("file:///testdir/testfile.xml");
-        assertNull(theURL);
-        
-        theURL = ResourceUtils.getLocalFile(null);
-        assertNull(theURL);
-    }
-
-    /**
-     * Test get resource as stream.
-     */
-    @Test
-    public void testGetResourceAsStream() {
-        InputStream theStream = ResourceUtils.getResourceAsStream(tmpDir.getAbsolutePath());
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(tmpEmptyFile.getAbsolutePath());
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(tmpUsedFile.getAbsolutePath());
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(jarDirResource);
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(jarFileResource);
-        assertNotNull(theStream);
-        
-        theStream = ResourceUtils.getResourceAsStream(pathDirResource);
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(pathFileResource);
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream("src/test/resources/" + pathDirResource);
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream("src/test/resources/" + pathFileResource);
-        assertNotNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(nonExistantResource);
-        assertNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(invalidResource);
-        assertNull(theStream);
-
-        theStream = ResourceUtils.getResourceAsStream(null);
-        assertNull(null);
-
-        theStream = ResourceUtils.getResourceAsStream("");
-        assertNull(null);
-    }
-
-    /**
-     * Test get resource as string.
-     */
-    @Test
-    public void testGetResourceAsString() {
-        String theString = ResourceUtils.getResourceAsString(tmpDir.getAbsolutePath());
-        assertNotNull(theString);
-
-        theString = ResourceUtils.getResourceAsString(tmpEmptyFile.getAbsolutePath());
-        assertTrue(theString.equals(""));
-
-        theString = ResourceUtils.getResourceAsString(tmpUsedFile.getAbsolutePath());
-        assertTrue(theString.equals("Bluebirds fly over the rainbow"));
-
-        theString = ResourceUtils.getResourceAsString(jarFileResource);
-        assertNotNull(theString);
-
-        theString = ResourceUtils.getResourceAsString(pathDirResource);
-        assertNotNull(theString);
-
-        theString = ResourceUtils.getResourceAsString(pathFileResource);
-        assertNotNull(theString);
-
-        theString = ResourceUtils.getResourceAsString("src/test/resources/" + pathDirResource);
-        assertNotNull(theString);
-
-        theString = ResourceUtils.getResourceAsString("src/test/resources/" + pathFileResource);
-        assertNotNull(theString);
-
-        theString = ResourceUtils.getResourceAsString(nonExistantResource);
-        assertNull(theString);
-
-        theString = ResourceUtils.getResourceAsString(invalidResource);
-        assertNull(theString);
-
-        theString = ResourceUtils.getResourceAsString(null);
-        assertNull(theString);
-
-        theString = ResourceUtils.getResourceAsString("");
-        assertEquals("org\ntestdir\n", theString);
-    }
-
-    @Test
-    public void testGetURL4Resource() {
-        URL theURL = ResourceUtils.getURL4Resource(tmpDir.getAbsolutePath());
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(tmpEmptyFile.getAbsolutePath());
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(tmpUsedFile.getAbsolutePath());
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(jarDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(jarFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(pathDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(pathFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource("src/test/resources/" + pathDirResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource("src/test/resources/" + pathFileResource);
-        assertNotNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(nonExistantResource);
-        assertNull(theURL);
-
-        theURL = ResourceUtils.getURL4Resource(invalidResource);
-        assertNull(theURL);
-    }
-
-    @Test
-    public void testGetFilePath4Resource() {
-        assertNull(ResourceUtils.getFilePath4Resource(null));
-        assertEquals("/something/else", ResourceUtils.getFilePath4Resource("/something/else"));
-        assertTrue(ResourceUtils.getFilePath4Resource("xml/example.xml").endsWith("xml/example.xml"));
-    }
-    
-    /**
-     * Cleandown resource utils test.
-     */
-    @After
-    public void cleandownResourceUtilsTest() {
-        tmpEmptyFile.delete();
-        tmpUsedFile.delete();
-    }
-}
