List of usage examples for org.apache.commons.vfs FileObject delete
public int delete(FileSelector selector) throws FileSystemException;
From source file:pt.webdetails.cpf.repository.VfsRepositoryTest.java
/** * Please do note this will remove the folder and all subfolders and files Used for testing purposes only * * @param file//from w w w . ja v a2s .c o m * @return */ public int removeUnsafe(String file) { try { if (file.equals(".")) { return repo.delete(Selectors.EXCLUDE_SELF); } FileObject f = resolveFile(repo, file); if (f.exists()) { return f.delete(Selectors.SELECT_ALL); } return -1; } catch (Exception e) { throw new RuntimeException("Cannot delete file: " + file, e); } }