public void deleteEntry(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { fallback.deleteEntry(href, base); }
public void deleteEntry(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { fallback.deleteEntry(href, base); }
public void deleteEntry(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.exists()) { throw new FileNotFoundException(file.toURI().toASCIIString()); } else if (!file.delete()) { throw new IOException("Could not delete " + file.toURI().toASCIIString()); } } else { fallback.deleteEntry(href, base); } }
public void deleteEntry(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.exists()) { throw new FileNotFoundException(file.toURI().toASCIIString()); } else if (!file.delete()) { throw new IOException("Could not delete " + file.toURI().toASCIIString()); } } else { fallback.deleteEntry(href, base); } }
public void deleteEntry(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { URI baseURI = URI.create(base); URI uri = baseURI.resolve(href); String sch = uri.getScheme(); if ("http".equalsIgnoreCase(sch) || "https".equalsIgnoreCase(sch)) { final HttpContext localContext = new BasicHttpContext(); execute(new HttpDelete(uri), new ResponseHandler<Void>() { public Void handleResponse(HttpResponse response) throws IOException { return null; } }, localContext); } else { fallback.deleteEntry(href, base); } }
public void deleteEntry(String href, String base) throws MalformedURLException, FileNotFoundException, IOException { URI baseURI = URI.create(base); URI uri = baseURI.resolve(href); String sch = uri.getScheme(); if ("http".equalsIgnoreCase(sch) || "https".equalsIgnoreCase(sch)) { final HttpContext localContext = new BasicHttpContext(); execute(new HttpDelete(uri), new ResponseHandler<Void>() { public Void handleResponse(HttpResponse response) throws IOException { return null; } }, localContext); } else { fallback.deleteEntry(href, base); } }
private void performDelete(RuntimeValue href, String base, boolean recursive, boolean fail_on_error) { DataStore store = runtime.getDataStore(); if (recursive) { try { for (String entry : getAllEntries(href.getString(), base)) { store.deleteEntry(entry, entry); } } catch (FileNotFoundException e) { if (fail_on_error) { throw new XProcException(step.getNode(), "Cannot delete: file does not exist", e); } } catch (IOException e) { if (fail_on_error) { throw new XProcException(step.getNode(), e); } } } try { store.deleteEntry(href.getString(), base); } catch (FileNotFoundException e) { if (fail_on_error) { throw new XProcException(step.getNode(), "Cannot delete: file does not exist", e); } } catch (IOException e) { if (fail_on_error) { throw new XProcException(step.getNode(), e); } } }
private void performDelete(RuntimeValue href, String base, boolean recursive, boolean fail_on_error) { DataStore store = runtime.getDataStore(); if (recursive) { try { for (String entry : getAllEntries(href.getString(), base)) { store.deleteEntry(entry, entry); } } catch (FileNotFoundException e) { if (fail_on_error) { throw new XProcException(step.getNode(), "Cannot delete: file does not exist", e); } } catch (IOException e) { if (fail_on_error) { throw new XProcException(step.getNode(), e); } } } try { store.deleteEntry(href.getString(), base); } catch (FileNotFoundException e) { if (fail_on_error) { throw new XProcException(step.getNode(), "Cannot delete: file does not exist", e); } } catch (IOException e) { if (fail_on_error) { throw new XProcException(step.getNode(), e); } } }
store.deleteEntry(href.getString(), base);
store.deleteEntry(href.getString(), base);