public URI createList(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { return fallback.createList(href, base); }
public URI createList(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { return fallback.createList(href, base); }
public URI createList(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { return fallback.createList(href, base); }
public URI createList(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { return fallback.createList(href, base); }
public URI createList(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { URI baseURI = URI.create(base); URI uri = baseURI.resolve(href); if ("file".equalsIgnoreCase(uri.getScheme())) { File file = URIUtils.toFile(uri); if (file.isDirectory()) { return file.toURI(); } else if (file.exists()) { throw new FileNotFoundException(file.toURI().toASCIIString()); } else { if (file.mkdirs()) { return file.toURI(); } else { throw new IOException("Could not create directory: " + file.getAbsolutePath()); } } } else { return fallback.createList(href, base); } }
public URI createList(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { URI baseURI = URI.create(base); URI uri = baseURI.resolve(href); if ("file".equalsIgnoreCase(uri.getScheme())) { File file = URIUtils.toFile(uri); if (file.isDirectory()) { return file.toURI(); } else if (file.exists()) { throw new FileNotFoundException(file.toURI().toASCIIString()); } else { if (file.mkdirs()) { return file.toURI(); } else { throw new IOException("Could not create directory: " + file.getAbsolutePath()); } } } else { return fallback.createList(href, base); } }
public void run() throws SaxonApiException { super.run(); if (runtime.getSafeMode()) { throw XProcException.dynamicError(21); } RuntimeValue href = getOption(_href); TreeWriter tree = new TreeWriter(runtime); tree.startDocument(step.getNode().getBaseURI()); tree.addStartElement(XProcConstants.c_result); tree.startContent(); try { DataStore store = runtime.getDataStore(); URI uri = store.createList(href.getString(), href.getBaseURI().toASCIIString()); tree.addText(uri.toASCIIString()); } catch (FileNotFoundException e) { throw new XProcException(step.getNode(), "Cannot mkdir: file exists: " + href.getString()); } catch (IOException e) { throw new XProcException(step.getNode(), "Mkdir failed for: " + href.getString()); } tree.addEndElement(); tree.endDocument(); result.write(tree.getResult()); } }
public void run() throws SaxonApiException { super.run(); if (runtime.getSafeMode()) { throw XProcException.dynamicError(21); } RuntimeValue href = getOption(_href); TreeWriter tree = new TreeWriter(runtime); tree.startDocument(step.getNode().getBaseURI()); tree.addStartElement(XProcConstants.c_result); tree.startContent(); try { DataStore store = runtime.getDataStore(); URI uri = store.createList(href.getString(), href.getBaseURI().toASCIIString()); tree.addText(uri.toASCIIString()); } catch (FileNotFoundException e) { throw new XProcException(step.getNode(), "Cannot mkdir: file exists: " + href.getString()); } catch (IOException e) { throw new XProcException(step.getNode(), "Mkdir failed for: " + href.getString()); } tree.addEndElement(); tree.endDocument(); result.write(tree.getResult()); } }