static Date parse(String str, boolean match) { Collection<DatePattern> patterns = patterns(match); for (DatePattern dp : patterns) { Date parsed = match ? dp.matchAndParse(str) : dp.parse(str); if (parsed != null) { return parsed; } } return null; }
@Override public void onApplicationEvent(ApplicationEvent event) { // load the context store here to avoid circular dependency on creation of the importer if (event instanceof ContextLoadedEvent) { contextStore = createContextStore(); contextStore.init(); } }
public static FileData createFromFile(File file) throws IOException { if (file.isDirectory()) { return new Directory(file); } if (new VFSWorker().canHandle(file)) { return new Archive(file); } return new SpatialFile(file); } public File getFile() {
void run(ImportTask task) throws IOException { if (task.getState() == ImportTask.State.COMPLETE) { return; } task.setState(ImportTask.State.RUNNING); if (task.isDirect()) { //direct import, simply add configured store and layers to catalog doDirectImport(task); } else { //indirect import, read data from the source and into the target datastore doIndirectImport(task); } }
public void changed(ImportTask task) throws IOException { prep(task); changed(task.getContext()); }
public ImportContext registerContext(Long id) throws IOException, IllegalArgumentException { ImportContext context = createContext(id); context.setState(org.geoserver.importer.ImportContext.State.INIT); return context; }
List<ImportTask> createTasks(ImportData data, ImportContext context) throws IOException { return createTasks(data, data.getFormat(), context); }
private void harvestDirectory(StructuredGridCoverage2DReader sr, Directory data) throws UnsupportedOperationException, IOException { for (FileData fd : data.getFiles()) { harvestImportData(sr, fd); } }
static Date parse(String str, boolean match) { Collection<DatePattern> patterns = patterns(match); for (DatePattern dp : patterns) { Date parsed = match ? dp.matchAndParse(str) : dp.parse(str); if (parsed != null) { return parsed; } } return null; }
@Override public void onApplicationEvent(ApplicationEvent event) { // load the context store here to avoid circular dependency on creation of the importer if (event instanceof ContextLoadedEvent) { contextStore = createContextStore(); contextStore.init(); } }