List of usage examples for org.apache.commons.vfs FileObject copyFrom
public void copyFrom(FileObject srcFile, FileSelector selector) throws FileSystemException;
From source file:pt.webdetails.cpf.repository.vfs.VfsRepositoryAccess.java
public SaveFileStatus copySolutionFile(String fromFilePath, String toFilePath) throws IOException { try {//from w ww .j a v a 2s. c o m FileObject to = resolveFile(repo, toFilePath); FileObject from = resolveFile(repo, fromFilePath); to.copyFrom(from, Selectors.SELECT_SELF); if (to != null && to.exists() && to.isReadable()) { return SaveFileStatus.OK; } } catch (Exception e) { log.error("Cannot copy from " + fromFilePath + " to " + toFilePath, e); } return SaveFileStatus.FAIL; }