public void listEachEntry(String href, String base, String accept, DataInfo handler) throws MalformedURLException, FileNotFoundException, IOException { fallback.listEachEntry(href, base, accept, handler); }
public void listEachEntry(String href, String base, String accept, DataInfo handler) throws MalformedURLException, FileNotFoundException, IOException { fallback.listEachEntry(href, base, accept, handler); }
public void listEachEntry(String href, String base, String accept, DataInfo handler) throws MalformedURLException, FileNotFoundException, IOException { fallback.listEachEntry(href, base, accept, handler); }
public void listEachEntry(String href, String base, String accept, DataInfo handler) throws MalformedURLException, FileNotFoundException, IOException { fallback.listEachEntry(href, base, accept, handler); }
private List<String> getAllEntries(final String href, String base) throws MalformedURLException, FileNotFoundException, IOException { final List<String> entries = new ArrayList<String>(); DataStore store = runtime.getDataStore(); store.listEachEntry(href, base, "*/*", new DataStore.DataInfo() { public void list(URI id, String media, long lastModified) throws IOException { String entry = id.toASCIIString(); try { entries.addAll(getAllEntries(entry, entry)); } catch (FileNotFoundException e) { // ignore it, we tried to recurse through a file that wasn't a directory } entries.add(entry); } }); return entries; } }
private List<String> getAllEntries(final String href, String base) throws MalformedURLException, FileNotFoundException, IOException { final List<String> entries = new ArrayList<String>(); DataStore store = runtime.getDataStore(); store.listEachEntry(href, base, "*/*", new DataStore.DataInfo() { public void list(URI id, String media, long lastModified) throws IOException { String entry = id.toASCIIString(); try { entries.addAll(getAllEntries(entry, entry)); } catch (FileNotFoundException e) { // ignore it, we tried to recurse through a file that wasn't a directory } entries.add(entry); } }); return entries; } }
public void list(URI id, String media, long lastModified) throws IOException { final String accept = pattern == null ? ACCEPT_XML : "*/*"; final DataReader handler = new DataReader() { public void load(URI id, String media, InputStream content, long len) throws IOException { content.close(); String name = new File(id).getName(); if (pattern == null || pattern.matcher(name).matches()) { documents.add(parse(id.toASCIIString(), base)); } } }; String entry = id.toASCIIString(); if (media == null) { store.listEachEntry(entry, entry, accept, new DataInfo() { public void list(URI id, String media, long lastModified) throws IOException { String entry = id.toASCIIString(); store.readEntry(entry, entry, accept, null, handler); } }); } else { store.readEntry(entry, entry, accept, null, handler); } } });
public void list(URI id, String media, long lastModified) throws IOException { final String accept = pattern == null ? ACCEPT_XML : "*/*"; final DataReader handler = new DataReader() { public void load(URI id, String media, InputStream content, long len) throws IOException { content.close(); String name = new File(id).getName(); if (pattern == null || pattern.matcher(name).matches()) { documents.add(parse(id.toASCIIString(), base)); } } }; String entry = id.toASCIIString(); if (media == null) { store.listEachEntry(entry, entry, accept, new DataInfo() { public void list(URI id, String media, long lastModified) throws IOException { String entry = id.toASCIIString(); store.readEntry(entry, entry, accept, null, handler); } }); } else { store.readEntry(entry, entry, accept, null, handler); } } });
public void listEachEntry(String href, String base, String accept, DataInfo handler) 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.canRead()) { throw XProcException.stepError(12); } if (file.isDirectory()) { for (File f : listAcceptableFiles(file, accept)) { String type; if (f.isDirectory()) { type = null; } else { type = getContentTypeFromName(f.getName()); } handler.list(f.toURI(), type, f.lastModified()); } } else { throw new FileNotFoundException(file.getAbsolutePath() + " is not a directory"); } } else { fallback.listEachEntry(href, base, accept, handler); } }
public void listEachEntry(String href, String base, String accept, DataInfo handler) 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.canRead()) { throw XProcException.stepError(12); } if (file.isDirectory()) { for (File f : listAcceptableFiles(file, accept)) { String type; if (f.isDirectory()) { type = null; } else { type = getContentTypeFromName(f.getName()); } handler.list(f.toURI(), type, f.lastModified()); } } else { throw new FileNotFoundException(file.getAbsolutePath() + " is not a directory"); } } else { fallback.listEachEntry(href, base, accept, handler); } }
store.listEachEntry(path, "file:///", "*/*", new DataInfo() { public void list(URI id, String media, long lastModified) throws IOException { boolean use = true;
store.listEachEntry(path, "file:///", "*/*", new DataInfo() { public void list(URI id, String media, long lastModified) throws IOException { boolean use = true;