@Test public void testMoveRoomToDirectory() throws Exception { final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session).withCache(cache); final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(new Path( new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume, Path.Type.triplecrypt)), null, new TransferStatus()); final Path target = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); final Path test = new SDSDirectoryFeature(session, nodeid).mkdir(new Path( new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume, Path.Type.triplecrypt)), null, new TransferStatus()); final SDSMoveFeature move = new SDSMoveFeature(session, nodeid); assertFalse(move.isSupported(test, target)); }
@Override public boolean isSupported(final Path source, final Path target) { if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) { return session.getFeature(Copy.class).isSupported(source, target); } return proxy.isSupported(source, target); }
SDSDelegatingMoveFeature implements Move { @Override public boolean isSupported(final Path source, final Path target) { if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) { return session.getFeature(Copy.class).isSupported(source, target); } return proxy.isSupported(source, target); } }
SDSDelegatingMoveFeature implements Move { @Override public boolean isSupported(final Path source, final Path target) { if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) { return session.getFeature(Copy.class).isSupported(source, target); } return proxy.isSupported(source, target); } SDSDelegatingMoveFeature(final SDSSession session, final SDSNodeIdProvider nodeid, final SDSMoveFeature proxy); }
SDSDelegatingMoveFeature implements Move { @Override public boolean isSupported(final Path source, final Path target) { if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) { return session.getFeature(Copy.class).isSupported(source, target); } return proxy.isSupported(source, target); } SDSDelegatingMoveFeature(final SDSSession session, final SDSNodeIdProvider nodeid, final SDSMoveFeature proxy); @Override Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback,
                     final ConnectionCallback connectionCallback); @Override boolean isRecursive(final Path source, final Path target); @Override boolean isSupported(final Path source, final Path target); @Override String toString(); }
SDSDelegatingMoveFeature implements Move { @Override public boolean isSupported(final Path source, final Path target) { if(nodeid.isEncrypted(source) ^ nodeid.isEncrypted(target)) { return session.getFeature(Copy.class).isSupported(source, target); } return proxy.isSupported(source, target); } SDSDelegatingMoveFeature(final SDSSession session, final SDSNodeIdProvider nodeid, final SDSMoveFeature proxy); @Override Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback,
                     final ConnectionCallback connectionCallback); @Override boolean isRecursive(final Path source, final Path target); @Override boolean isSupported(final Path source, final Path target); @Override String toString();  }