@Test(expected = AccessDeniedException.class) public void testDisallowedName() throws Exception { final DropboxTouchFeature touch = new DropboxTouchFeature(session); final Path file = new Path(new DropboxHomeFinderFeature(session).find(), String.format("~%s.tmp", UUID.randomUUID().toString()), EnumSet.of(Path.Type.file)); assertFalse(touch.isSupported(new DropboxHomeFinderFeature(session).find(), file.getName())); touch.touch(file, new TransferStatus()); }
@Override public boolean isSupported(final Path workdir, final String filename) { if(StringUtils.startsWith(filename, "~$")) { return false; } if(StringUtils.startsWith(filename, "~") && StringUtils.endsWith(filename, ".tmp")) { return false; } return true; }
DropboxTouchFeature extends DefaultTouchFeature<String> { @Override public boolean isSupported(final Path workdir, final String filename) { if(StringUtils.startsWith(filename, "~$")) { return false; } if(StringUtils.startsWith(filename, "~") && StringUtils.endsWith(filename, ".tmp")) { return false; } return true; } }
DropboxTouchFeature extends DefaultTouchFeature<String> { @Override public boolean isSupported(final Path workdir, final String filename) { if(StringUtils.startsWith(filename, "~$")) { return false; } if(StringUtils.startsWith(filename, "~") && StringUtils.endsWith(filename, ".tmp")) { return false; } return true; } DropboxTouchFeature(final DropboxSession session); }
DropboxTouchFeature extends DefaultTouchFeature<String> { @Override public boolean isSupported(final Path workdir, final String filename) { if(StringUtils.startsWith(filename, "~$")) { return false; } if(StringUtils.startsWith(filename, "~") && StringUtils.endsWith(filename, ".tmp")) { return false; } return true; } DropboxTouchFeature(final DropboxSession session); @Override boolean isSupported(final Path workdir, final String filename); }
DropboxTouchFeature extends DefaultTouchFeature<String> { @Override public boolean isSupported(final Path workdir, final String filename) { if(StringUtils.startsWith(filename, "~$")) { return false; } if(StringUtils.startsWith(filename, "~") && StringUtils.endsWith(filename, ".tmp")) { return false; } return true; } DropboxTouchFeature(final DropboxSession session); @Override boolean isSupported(final Path workdir, final String filename);  }