public InputStream getDocument(String documentPath) throws IOException { if (isForbidden(documentPath)) { throw new IOException("Document path: " + documentPath + " is within a protected directory, cannot retrieve input stream"); } String resourcePath = toResourcePath(documentPath); Resource resource = this.resolver.getResource(resourcePath); return resource.getInputStream(); }
public InputStream getDocument(String documentPath) throws IOException { if (isForbidden(documentPath)) { throw new IOException("Document path: " + documentPath + " is within a protected directory, cannot retrieve input stream"); } String resourcePath = toResourcePath(documentPath); Resource resource = this.resolver.getResource(resourcePath); return resource.getInputStream(); }
public boolean hasDocument(String documentPath) { boolean has = false; if (!isForbidden(documentPath)) { String resourcePath = toResourcePath(documentPath); Resource resource = this.resolver.getResource(resourcePath); has = resource.exists(); } return has; }
public boolean hasDocument(String documentPath) { boolean has = false; if (!isForbidden(documentPath)) { String resourcePath = toResourcePath(documentPath); Resource resource = this.resolver.getResource(resourcePath); has = resource.exists(); } return has; }
public long lastModified(String documentPath) throws IOException { long lastModified = -1; if (!isForbidden(documentPath)) { String resourcePath = toResourcePath(documentPath); Resource resource = this.resolver.getResource(resourcePath); lastModified = resource.lastModified(); } return lastModified; }
public long lastModified(String documentPath) throws IOException { long lastModified = -1; if (!isForbidden(documentPath)) { String resourcePath = toResourcePath(documentPath); Resource resource = this.resolver.getResource(resourcePath); lastModified = resource.lastModified(); } return lastModified; }