public void createFile(Persistent p, File file, String filename) throws IOException { File target = createTargetFile(p.getClass(), p.getId(), filename); FileUtils.deleteQuietly(target); FileUtils.copyFile(file, target); }
public void createFile(Persistent p, MultipartFile file, String filename) throws IOException { createFile(p.getClass(), p.getId(), file, filename); }
/** * Get all of the files that are associated with the given Persistent instance. * * @param p <code>Persistent</code>. * @return <code>List</code> of <code>javax.activation.FileDataSource</code> . */ public List<FileDataSource> getFiles(Persistent p) { return getFiles(p.getClass(), p.getId()); }
/** * Get a single file that is owned by a given <code>Persistent</code>. * * @param p <code>Persistent</code>. * @param fileName The name of the file. * @return <code>FileDataSource</code>. */ public FileDataSource getFile(Persistent p, String fileName) { return getFile(p.getClass(), p.getId(), fileName); }
public File getTargetDirectory(Persistent p, String name, boolean createIfMissing) throws IOException { return this.getTargetDirectory(p.getClass(), p.getId(), name, createIfMissing); }