/** * Add all resources from the directory to the virtual web application content. * * @param path * name of the target directory in the virtual web application. If no such directory exists, it will be * created, as well as all parent directories as needed. * @param resource * {@code URL} to the source directory or any file in the source directory. Only 'file' or 'jar' * protocols are supported. If this parameter points to a file, it will be converted to a enclosing * directory. */ public void addResourcesFromDirectory(String path, URL resource) { String protocol = resource.getProtocol(); if ("jar".equals(protocol)) { addResourcesFromJar(path, resource); } else if ("file".equals(protocol)) { addResourcesFromFile(path, resource); } else { throw new TestException("Unsupported protocol " + protocol); } }
/** * Add all resources from the directory to the virtual web application content. * * @param path * name of the target directory in the virtual web application. If no such directory exists, it will be * created, as well as all parent directories as needed. * @param resource * {@code URL} to the source directory or any file in the source directory. Only 'file' or 'jar' * protocols are supported. If this parameter points to a file, it will be converted to a enclosing * directory. */ public void addResourcesFromDirectory(String path, URL resource) { String protocol = resource.getProtocol(); if ("jar".equals(protocol)) { addResourcesFromJar(path, resource); } else if ("file".equals(protocol)) { addResourcesFromFile(path, resource); } else { throw new TestException("Unsupported protocol " + protocol); } }