public long lastModified(String documentPath) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Unable to locate file to check modification time: " + documentPath); } return file.lastModified(); }
public boolean hasDocument(String documentPath) { File file = new File(toAbsolutePath(documentPath)); return (file != null && file.exists() && file.isFile()); }
public boolean hasDocument(String documentPath) { File file = new File(toAbsolutePath(documentPath)); return (file != null && file.exists() && file.isFile()); }
private Reader getReader(String encoding) throws IOException { Reader reader = null; File f = new File(toAbsolutePath(templatePath)); if (f.exists()) { reader = new FileReader(f); } return reader; } }
public long lastModified(String documentPath) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Unable to locate file to check modification time: " + documentPath); } return file.lastModified(); }
public InputStream getDocument(String documentPath) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Unable to get input stream from document: " + documentPath); } return new FileInputStream(file); }
public boolean removeDocument(String documentPath) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Update to remove document failed, file not found: " + documentPath); } return file.delete(); }
public InputStream getDocument(String documentPath) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Unable to get input stream from document: " + documentPath); } return new FileInputStream(file); }
private Reader getReader(String encoding) throws IOException { Reader reader = null; File f = new File(toAbsolutePath(templatePath)); if (f.exists()) { reader = new FileReader(f); } return reader; } }
public boolean removeDocument(String documentPath) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Update to remove document failed, file not found: " + documentPath); } return file.delete(); }
public void updateDocument(String documentPath, String content) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Unable to locate file for update: " + documentPath); } FileWriter fw = new FileWriter(file); try { fw.write(content); } finally { fw.close(); } }
public void updateDocument(String documentPath, String content) throws IOException { File file = new File(toAbsolutePath(documentPath)); if (file == null) { throw new IOException( "Unable to locate file for update: " + documentPath); } FileWriter fw = new FileWriter(file); try { fw.write(content); } finally { fw.close(); } }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getReader() */ public Reader getReader() { Reader reader = null; try { File f = new File(toAbsolutePath(scriptPath)); if (f.exists()) { reader = new FileReader(f); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return reader; }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getInputStream() */ public InputStream getInputStream() { InputStream is = null; try { File f = new File(toAbsolutePath(scriptPath)); if (f.exists()) { is = new FileInputStream(f); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return is; }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getInputStream() */ public InputStream getInputStream() { InputStream is = null; try { File f = new File(toAbsolutePath(scriptPath)); if (f.exists()) { is = new FileInputStream(f); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return is; }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getReader() */ public Reader getReader() { Reader reader = null; try { File f = new File(toAbsolutePath(scriptPath)); if (f.exists()) { reader = new FileReader(f); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return reader; }
String absParentPath = toAbsolutePath(path); int absParentPathLen = absParentPath.length() - 1; File f = new File(absParentPath);
File file = new File(toAbsolutePath(documentPath)); if (file.getParentFile().exists())
String absParentPath = toAbsolutePath(path); int absParentPathLen = absParentPath.length() - 1; File f = new File(absParentPath);
File file = new File(toAbsolutePath(documentPath)); if (file.getParentFile().exists())