public static void transferTestInputDirectory(String directory, boolean searchSubdirectories) throws IOException { transferTestInputDirectory(new ResourcesDirectoryReader(testdataInputRoot + directory, searchSubdirectories), directory); }
public static void transferTestInputDirectory(String directory, boolean searchSubdirectories, String filter) throws IOException { transferTestInputDirectory(new ResourcesDirectoryReader(testdataInputRoot + directory, searchSubdirectories, filter), directory); }
public static void transferTestInputDirectory(String directory, boolean searchSubdirectories, ResourcesFilterIF filter) throws IOException { transferTestInputDirectory(new ResourcesDirectoryReader(testdataInputRoot + directory, searchSubdirectories, filter), directory); }
public static List<String[]> getTestInputFiles(String directory, ResourcesFilterIF filter) { String resourcesDirectory = testdataInputRoot + directory; ResourcesDirectoryReader directoryReader = new ResourcesDirectoryReader(resourcesDirectory, filter); return getTestInputFiles(directoryReader, resourcesDirectory); }
public static List<String[]> getTestInputFiles(String directory, String filter) { String resourcesDirectory = testdataInputRoot + directory; ResourcesDirectoryReader directoryReader = new ResourcesDirectoryReader(resourcesDirectory, filter); return getTestInputFiles(directoryReader, resourcesDirectory); }
public static void transferTestInputDirectory(String directory) throws IOException { transferTestInputDirectory(new ResourcesDirectoryReader(testdataInputRoot + directory), directory); }
public static List<Object[]> getTestInputURLs(ResourcesFilterIF filter, String... pathParts) { String path = testdataInputRoot; for (String part : pathParts) { path += part + File.separator; } ResourcesDirectoryReader directoryReader = (filter == null ? new ResourcesDirectoryReader(path) : new ResourcesDirectoryReader(path, filter)); Collection<Object[]> collected = org.apache.commons.collections4.CollectionUtils.collect(directoryReader.getResources(), new Transformer<URL, Object[]>() { @Override public Object[] transform(URL input) { Object[] o = new Object[2]; o[0] = input; o[1] = input.getFile().substring(input.getFile().lastIndexOf("/") + 1); return o; } }); return new ArrayList<>(collected); }
protected Map refreshFromClasspath() { if (!filter.equals(this)) { throw new OntopiaRuntimeException("AbstractPathTopicMapSource.refreshFromClasspath does not yet support filtering"); } Map newmap = new HashMap(); ResourcesDirectoryReader reader = new ResourcesDirectoryReader(path.substring("classpath:".length()), suffix); for (URL resource : reader.getResources()) { String file = resource.getFile(); String id = file.substring(file.lastIndexOf('/') + 1); TopicMapReferenceIF ref = createReference(resource, id, id); if (ref != null) { newmap.put(id, ref); } } return newmap; }