/** * Constructs a CSV DataContext based on a {@link URL} * * @param url * @param configuration */ public CsvDataContext(URL url, CsvConfiguration configuration) { _resource = new UrlResource(url); _configuration = configuration; _writable = false; }
@Override public UrlResource parsePath(String path) { return new UrlResource(path); }
/** * Constructs a CSV DataContext based on a {@link URL} * * @param url * @param configuration */ public CsvDataContext(URL url, CsvConfiguration configuration) { _resource = new UrlResource(url); _configuration = configuration; _writable = false; }
@Override public UrlResource parsePath(final String path) { return new UrlResource(path); }
public XmlDomDataContext(URL url, boolean autoFlattenTables) throws IllegalArgumentException { this(new UrlResource(url), autoFlattenTables); }
private UrlResource getUrlResourceDelegate() { ClassLoader classLoader = getClassLoader(); URL url = classLoader.getResource(_resourcePath); if (url == null && _resourcePath.startsWith("/")) { url = classLoader.getResource(_resourcePath.substring(1)); } if (url == null) { return null; } return new UrlResource(url); }
private UrlResource getUrlResourceDelegate() { ClassLoader classLoader = getClassLoader(); URL url = classLoader.getResource(_resourcePath); if (url == null && _resourcePath.startsWith("/")) { url = classLoader.getResource(_resourcePath.substring(1)); } if (url == null) { return null; } return new UrlResource(url); }
@Override public Resource create(ResourceProperties properties) throws UnsupportedResourcePropertiesException { try { return new UrlResource(properties.getUri().toURL()); } catch (MalformedURLException e) { throw new UnsupportedResourcePropertiesException(e); } } }
@Override public Resource create(ResourceProperties properties) throws UnsupportedResourcePropertiesException { try { return new UrlResource(properties.getUri().toURL()); } catch (MalformedURLException e) { throw new UnsupportedResourcePropertiesException(e); } } }
protected Resource getResource(DataContextFactoryParameters params) { final org.springframework.core.io.Resource resource = params.getResource(); if (resource != null) { return new SpringResource(resource); } else if (params.getFilename() != null) { return new FileResource(params.getFilename()); } else if (params.getUrl() != null) { return new UrlResource(params.getUrl()); } return null; }