@Override
    public Path copy(final Path source, final Path target, final TransferStatus status, final ConnectionCallback callback, final StreamListener listener) throws BackgroundException {
        try {
            final File copy = session.getClient().files().copy(fileid.getFileId(source), new File()
                    .setParents(Collections.singletonList(fileid.getFileId(target.getParent())))
                    .setName(target.getName()))
                .setSupportsAllDrives(new HostPreferences(session.getHost()).getBoolean("googledrive.teamdrive.enable")).execute();
            listener.sent(status.getLength());
            fileid.cache(target, copy.getId());
            return target.withAttributes(new DriveAttributesFinderFeature(session, fileid).toAttributes(copy));
        }
        catch(IOException e) {
            throw new DriveExceptionMappingService(fileid).map("Cannot copy {0}", e, source);
        }
    }
@Test
    public void testCopyFile() throws Exception {
        final Path test = new Path(DriveHomeFinderService.MYDRIVE_FOLDER, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
        final DriveFileIdProvider fileid = new DriveFileIdProvider(session);
        final TransferStatus status = new TransferStatus();
        new DriveTouchFeature(session, fileid).touch(test, status);
        final Path copy = new Path(DriveHomeFinderService.MYDRIVE_FOLDER, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
        final Path target = new DriveCopyFeature(session, fileid).copy(test, copy, new TransferStatus(), new DisabledConnectionCallback(), new DisabledStreamListener());
        assertNotEquals(test.attributes().getFileId(), target.attributes().getFileId());
        final Find find = new DefaultFindFeature(session);
        assertTrue(find.find(test));
        assertTrue(find.find(copy));
        new DriveDeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }