public String[] getDescriptionDocumentPaths() throws IOException { return getDocumentPaths("/", true, DESC_PATH_PATTERN); }
public String getPathDescription() { return "classpath*:" + ClassPathStore.createPath(basePath, path); }
public InputStream getDocument(String documentPath) throws IOException { Resource document = this.getDocumentResource(documentPath); if (document == null || !document.exists()) { throw new IOException("Document " + documentPath + " does not exist within store " + getBasePath()); } if (logger.isTraceEnabled()) logger.trace("getDocument: documentPath: " + documentPath + " , storePath: " + document.getURL().toExternalForm()); return document.getInputStream(); }
/** * Matches the given path to the full class path that is comprised of class files and resources located * inside of JAR files that are on the class path. * * @param pattern The pattern to match * * @return List<String> of matching paths */ private List<String> matchDocumentPaths(String pattern) throws IOException { Resource[] resources = getDocumentResources(pattern); List<String> documentPaths = new ArrayList<String>(resources.length); for (Resource resource : resources) { String documentPath = toDocumentPath(resource.getURL().toExternalForm()); documentPaths.add(documentPath); } return documentPaths; }
if (isJarURL(url)) String jarUrlString = extractJarFileURL(url).toExternalForm();
/** * @see freemarker.cache.TemplateLoader#findTemplateSource(java.lang.String) */ public Object findTemplateSource(String name) throws IOException { ClassPathTemplateSource source = null; if (hasDocument(name)) { source = new ClassPathTemplateSource(name); } return source; }
public boolean hasDocument(String documentPath) { boolean exists = false; Resource document = this.getDocumentResource(documentPath); if (document != null) { exists = document.exists(); } return exists; }
public String[] getAllDocumentPaths() { String[] paths; try { List<String> documentPaths = matchDocumentPaths("/**/*"); paths = documentPaths.toArray(new String[documentPaths.size()]); } catch (IOException e) { // Note: Ignore: no documents found paths = new String[0]; } return paths; }
protected long lastModified() { try { return ClassPathStore.this.lastModified(templatePath); } catch (IOException e) { return -1; } }
/** * Matches the given path to the full class path that is comprised of class files and resources located * inside of JAR files that are on the class path. * * @param pattern The pattern to match * * @return List<String> of matching paths */ private List<String> matchDocumentPaths(String pattern) throws IOException { Resource[] resources = getDocumentResources(pattern); List<String> documentPaths = new ArrayList<String>(resources.length); for (Resource resource : resources) { String documentPath = toDocumentPath(resource.getURL().toExternalForm()); documentPaths.add(documentPath); } return documentPaths; }
if (isJarURL(url)) String jarUrlString = extractJarFileURL(url).toExternalForm();
/** * @see freemarker.cache.TemplateLoader#findTemplateSource(java.lang.String) */ public Object findTemplateSource(String name) throws IOException { ClassPathTemplateSource source = null; if (hasDocument(name)) { source = new ClassPathTemplateSource(name); } return source; }
public boolean hasDocument(String documentPath) { boolean exists = false; Resource document = this.getDocumentResource(documentPath); if (document != null) { exists = document.exists(); } return exists; }
public String[] getAllDocumentPaths() { String[] paths; try { List<String> documentPaths = matchDocumentPaths("/**/*"); paths = documentPaths.toArray(new String[documentPaths.size()]); } catch (IOException e) { // Note: Ignore: no documents found paths = new String[0]; } return paths; }
protected long lastModified() { try { return ClassPathStore.this.lastModified(templatePath); } catch (IOException e) { return -1; } }
public String[] getDescriptionDocumentPaths() throws IOException { return getDocumentPaths("/", true, DESC_PATH_PATTERN); }
public InputStream getDocument(String documentPath) throws IOException { Resource document = this.getDocumentResource(documentPath); if (document == null || !document.exists()) { throw new IOException("Document " + documentPath + " does not exist within store " + getBasePath()); } if (logger.isTraceEnabled()) logger.trace("getDocument: documentPath: " + documentPath + " , storePath: " + document.getURL().toExternalForm()); return document.getInputStream(); }
/** * Matches the given path to the full class path that is comprised of class files and resources located * inside of JAR files that are on the class path. * * @param pattern The pattern to match * * @return List<String> of matching paths */ private List<String> matchDocumentPaths(String pattern) throws IOException { Resource[] resources = getDocumentResources(pattern); List<String> documentPaths = new ArrayList<String>(resources.length); for (Resource resource : resources) { String documentPath = toDocumentPath(resource.getURL().toExternalForm()); documentPaths.add(documentPath); } return documentPaths; }
if (isJarURL(url)) String jarUrlString = extractJarFileURL(url).toExternalForm();
/** * @see freemarker.cache.TemplateLoader#findTemplateSource(java.lang.String) */ public Object findTemplateSource(String name) throws IOException { ClassPathTemplateSource source = null; if (hasDocument(name)) { source = new ClassPathTemplateSource(name); } return source; }