@Test public void testTrash() throws Exception { Local l = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); new DefaultLocalTouchFeature().touch(l); assertTrue(l.exists()); new NativeLocalTrashFeature().trash(l); assertFalse(l.exists()); }
@Override public void trash(final Local file) throws LocalAccessDeniedException { try { FileUtils.getInstance().moveToTrash(new File[]{new File(file.getAbsolute())}); } catch(IOException e) { log.warn(String.format("Failed to move %s to Trash", file.getName())); new DefaultLocalTrashFeature().trash(file); } }
NativeLocalTrashFeature implements Trash { @Override public void trash(final Local file) throws LocalAccessDeniedException { try { FileUtils.getInstance().moveToTrash(new File[]{new File(file.getAbsolute())}); } catch(IOException e) { log.warn(String.format("Failed to move %s to Trash", file.getName())); new DefaultLocalTrashFeature().trash(file); } } }
NativeLocalTrashFeature implements Trash { @Override public void trash(final Local file) throws LocalAccessDeniedException { try { FileUtils.getInstance().moveToTrash(new File[]{new File(file.getAbsolute())}); } catch(IOException e) { log.warn(String.format("Failed to move %s to Trash", file.getName())); new DefaultLocalTrashFeature().trash(file); } }  }
NativeLocalTrashFeature implements Trash { @Override public void trash(final Local file) throws LocalAccessDeniedException { try { FileUtils.getInstance().moveToTrash(new File[]{new File(file.getAbsolute())}); } catch(IOException e) { log.warn(String.format("Failed to move %s to Trash", file.getName())); new DefaultLocalTrashFeature().trash(file); } }  @Override void trash(final Local file); }
NativeLocalTrashFeature implements Trash { @Override public void trash(final Local file) throws LocalAccessDeniedException { try { FileUtils.getInstance().moveToTrash(new File[]{new File(file.getAbsolute())}); } catch(IOException e) { log.warn(String.format("Failed to move %s to Trash", file.getName())); new DefaultLocalTrashFeature().trash(file); } }  @Override void trash(final Local file);  }