Search in sources :

Example 1 with DefaultLocalDirectoryFeature

use of ch.cyberduck.core.local.DefaultLocalDirectoryFeature in project cyberduck by iterate-ch.

the class CryptoB2SingleTransferWorkerTest method testUpload.

@Test
public void testUpload() throws Exception {
    final Path home = new Path("/test-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path dir1 = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Local localDirectory1 = new Local(System.getProperty("java.io.tmpdir"), new AlphanumericRandomStringService().random());
    new DefaultLocalDirectoryFeature().mkdir(localDirectory1);
    final byte[] content = RandomUtils.nextBytes(62768);
    final Path file1 = new Path(dir1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile1 = new Local(localDirectory1, file1.getName());
    final OutputStream out1 = localFile1.getOutputStream(false);
    IOUtils.write(content, out1);
    out1.close();
    final Path file2 = new Path(dir1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile2 = new Local(localDirectory1, file2.getName());
    final OutputStream out2 = localFile2.getOutputStream(false);
    IOUtils.write(content, out2);
    out2.close();
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    final Transfer t = new UploadTransfer(new Host(new TestProtocol()), Collections.singletonList(new TransferItem(dir1, localDirectory1)), new NullFilter<>());
    assertTrue(new SingleTransferWorker(session, session, t, new TransferOptions(), new TransferSpeedometer(t), new DisabledTransferPrompt() {

        @Override
        public TransferAction prompt(final TransferItem file) {
            return TransferAction.overwrite;
        }
    }, new DisabledTransferErrorCallback(), new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {
    }.run(session));
    final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
    assertTrue(new CryptoFindFeature(session, new B2FindFeature(session, fileid), cryptomator).find(dir1));
    assertEquals(content.length, new CryptoAttributesFeature(session, new B2AttributesFinderFeature(session, fileid), cryptomator).find(file1).getSize());
    {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
        final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(file1, new TransferStatus().withLength(content.length), new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
        assertArrayEquals(content, buffer.toByteArray());
    }
    assertEquals(content.length, new CryptoAttributesFeature(session, new B2AttributesFinderFeature(session, fileid), cryptomator).find(file2).getSize());
    {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
        final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(file1, new TransferStatus().withLength(content.length), new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
        assertArrayEquals(content, buffer.toByteArray());
    }
    cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(file1, file2, dir1, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    localFile1.delete();
    localFile2.delete();
    localDirectory1.delete();
}
Also used : Delete(ch.cyberduck.core.features.Delete) TestProtocol(ch.cyberduck.core.TestProtocol) B2ReadFeature(ch.cyberduck.core.b2.B2ReadFeature) TransferAction(ch.cyberduck.core.transfer.TransferAction) ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) SingleTransferWorker(ch.cyberduck.core.worker.SingleTransferWorker) B2VersionIdProvider(ch.cyberduck.core.b2.B2VersionIdProvider) B2AttributesFinderFeature(ch.cyberduck.core.b2.B2AttributesFinderFeature) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) B2DeleteFeature(ch.cyberduck.core.b2.B2DeleteFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultLocalDirectoryFeature(ch.cyberduck.core.local.DefaultLocalDirectoryFeature) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) CryptoReadFeature(ch.cyberduck.core.cryptomator.features.CryptoReadFeature) DisabledTransferErrorCallback(ch.cyberduck.core.transfer.DisabledTransferErrorCallback) Path(ch.cyberduck.core.Path) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledNotificationService(ch.cyberduck.core.notification.DisabledNotificationService) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) DisabledStreamListener(ch.cyberduck.core.io.DisabledStreamListener) InputStream(java.io.InputStream) Local(ch.cyberduck.core.Local) Host(ch.cyberduck.core.Host) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) CryptoAttributesFeature(ch.cyberduck.core.cryptomator.features.CryptoAttributesFeature) DisabledTransferPrompt(ch.cyberduck.core.transfer.DisabledTransferPrompt) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) B2FindFeature(ch.cyberduck.core.b2.B2FindFeature) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) Transfer(ch.cyberduck.core.transfer.Transfer) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) TransferSpeedometer(ch.cyberduck.core.transfer.TransferSpeedometer) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) TransferItem(ch.cyberduck.core.transfer.TransferItem) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) IntegrationTest(ch.cyberduck.test.IntegrationTest) AbstractB2Test(ch.cyberduck.core.b2.AbstractB2Test) Test(org.junit.Test)

Example 2 with DefaultLocalDirectoryFeature

use of ch.cyberduck.core.local.DefaultLocalDirectoryFeature in project cyberduck by iterate-ch.

the class CryptoFTPSingleTransferWorkerTest method testUpload.

@Test
public void testUpload() throws Exception {
    final Path home = new DefaultHomeFinderService(session).find();
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path dir1 = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Local localDirectory1 = new Local(System.getProperty("java.io.tmpdir"), new AlphanumericRandomStringService().random());
    new DefaultLocalDirectoryFeature().mkdir(localDirectory1);
    final byte[] content = RandomUtils.nextBytes(62768);
    final Path file1 = new Path(dir1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile1 = new Local(localDirectory1, file1.getName());
    final OutputStream out1 = localFile1.getOutputStream(false);
    IOUtils.write(content, out1);
    out1.close();
    final Path file2 = new Path(dir1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile2 = new Local(localDirectory1, file2.getName());
    final OutputStream out2 = localFile2.getOutputStream(false);
    IOUtils.write(content, out2);
    out2.close();
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    final Transfer t = new UploadTransfer(new Host(new TestProtocol()), Collections.singletonList(new TransferItem(dir1, localDirectory1)), new NullFilter<>());
    assertTrue(new SingleTransferWorker(session, session, t, new TransferOptions(), new TransferSpeedometer(t), new DisabledTransferPrompt() {

        @Override
        public TransferAction prompt(final TransferItem file) {
            return TransferAction.overwrite;
        }
    }, new DisabledTransferErrorCallback(), new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {
    }.run(session));
    assertTrue(new CryptoFindFeature(session, new DefaultFindFeature(session), cryptomator).find(dir1));
    assertEquals(content.length, new CryptoAttributesFeature(session, new DefaultAttributesFinderFeature(session), cryptomator).find(file1).getSize());
    {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
        final InputStream in = new CryptoReadFeature(session, new FTPReadFeature(session), cryptomator).read(file1, new TransferStatus().withLength(content.length), new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
        assertArrayEquals(content, buffer.toByteArray());
    }
    assertEquals(content.length, new CryptoAttributesFeature(session, new DefaultAttributesFinderFeature(session), cryptomator).find(file2).getSize());
    {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
        final InputStream in = new CryptoReadFeature(session, new FTPReadFeature(session), cryptomator).read(file1, new TransferStatus().withLength(content.length), new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
        assertArrayEquals(content, buffer.toByteArray());
    }
    cryptomator.getFeature(session, Delete.class, new FTPDeleteFeature(session)).delete(Arrays.asList(file1, file2, dir1, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    localFile1.delete();
    localFile2.delete();
    localDirectory1.delete();
}
Also used : Delete(ch.cyberduck.core.features.Delete) TestProtocol(ch.cyberduck.core.TestProtocol) TransferAction(ch.cyberduck.core.transfer.TransferAction) ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) SingleTransferWorker(ch.cyberduck.core.worker.SingleTransferWorker) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) FTPDeleteFeature(ch.cyberduck.core.ftp.FTPDeleteFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) DefaultLocalDirectoryFeature(ch.cyberduck.core.local.DefaultLocalDirectoryFeature) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) CryptoReadFeature(ch.cyberduck.core.cryptomator.features.CryptoReadFeature) DisabledTransferErrorCallback(ch.cyberduck.core.transfer.DisabledTransferErrorCallback) Path(ch.cyberduck.core.Path) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledNotificationService(ch.cyberduck.core.notification.DisabledNotificationService) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) DisabledStreamListener(ch.cyberduck.core.io.DisabledStreamListener) InputStream(java.io.InputStream) Local(ch.cyberduck.core.Local) DefaultHomeFinderService(ch.cyberduck.core.shared.DefaultHomeFinderService) Host(ch.cyberduck.core.Host) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) CryptoAttributesFeature(ch.cyberduck.core.cryptomator.features.CryptoAttributesFeature) DisabledTransferPrompt(ch.cyberduck.core.transfer.DisabledTransferPrompt) DefaultAttributesFinderFeature(ch.cyberduck.core.shared.DefaultAttributesFinderFeature) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) Transfer(ch.cyberduck.core.transfer.Transfer) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) TransferSpeedometer(ch.cyberduck.core.transfer.TransferSpeedometer) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) TransferItem(ch.cyberduck.core.transfer.TransferItem) FTPReadFeature(ch.cyberduck.core.ftp.FTPReadFeature) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) IntegrationTest(ch.cyberduck.test.IntegrationTest) AbstractFTPTest(ch.cyberduck.core.ftp.AbstractFTPTest) Test(org.junit.Test)

Example 3 with DefaultLocalDirectoryFeature

use of ch.cyberduck.core.local.DefaultLocalDirectoryFeature in project cyberduck by iterate-ch.

the class CryptoS3SingleTransferWorkerTest method testUpload.

@Test
public void testUpload() throws Exception {
    final Path home = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory));
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path dir1 = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Local localDirectory1 = new Local(System.getProperty("java.io.tmpdir"), new AlphanumericRandomStringService().random());
    new DefaultLocalDirectoryFeature().mkdir(localDirectory1);
    final byte[] content = RandomUtils.nextBytes(62768);
    final Path file1 = new Path(dir1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile1 = new Local(localDirectory1, file1.getName());
    final OutputStream out1 = localFile1.getOutputStream(false);
    IOUtils.write(content, out1);
    out1.close();
    final Path file2 = new Path(dir1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile2 = new Local(localDirectory1, file2.getName());
    final OutputStream out2 = localFile2.getOutputStream(false);
    IOUtils.write(content, out2);
    out2.close();
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    final Transfer t = new UploadTransfer(new Host(new TestProtocol()), Collections.singletonList(new TransferItem(dir1, localDirectory1)), new NullFilter<>());
    assertTrue(new SingleTransferWorker(session, session, t, new TransferOptions(), new TransferSpeedometer(t), new DisabledTransferPrompt() {

        @Override
        public TransferAction prompt(final TransferItem file) {
            return TransferAction.overwrite;
        }
    }, new DisabledTransferErrorCallback(), new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {
    }.run(session));
    assertTrue(new CryptoFindFeature(session, new S3FindFeature(session), cryptomator).find(dir1));
    assertEquals(content.length, new CryptoAttributesFeature(session, new S3AttributesFinderFeature(session), cryptomator).find(file1).getSize());
    {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
        final InputStream in = new CryptoReadFeature(session, new S3ReadFeature(session), cryptomator).read(file1, new TransferStatus().withLength(content.length), new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
        assertArrayEquals(content, buffer.toByteArray());
    }
    assertEquals(content.length, new CryptoAttributesFeature(session, new S3AttributesFinderFeature(session), cryptomator).find(file2).getSize());
    {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
        final InputStream in = new CryptoReadFeature(session, new S3ReadFeature(session), cryptomator).read(file1, new TransferStatus().withLength(content.length), new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
        assertArrayEquals(content, buffer.toByteArray());
    }
    cryptomator.getFeature(session, Delete.class, new S3DefaultDeleteFeature(session)).delete(Arrays.asList(file1, file2, dir1, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    localFile1.delete();
    localFile2.delete();
    localDirectory1.delete();
}
Also used : Delete(ch.cyberduck.core.features.Delete) S3AttributesFinderFeature(ch.cyberduck.core.s3.S3AttributesFinderFeature) TestProtocol(ch.cyberduck.core.TestProtocol) TransferAction(ch.cyberduck.core.transfer.TransferAction) ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) SingleTransferWorker(ch.cyberduck.core.worker.SingleTransferWorker) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultLocalDirectoryFeature(ch.cyberduck.core.local.DefaultLocalDirectoryFeature) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) CryptoReadFeature(ch.cyberduck.core.cryptomator.features.CryptoReadFeature) DisabledTransferErrorCallback(ch.cyberduck.core.transfer.DisabledTransferErrorCallback) Path(ch.cyberduck.core.Path) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledNotificationService(ch.cyberduck.core.notification.DisabledNotificationService) S3FindFeature(ch.cyberduck.core.s3.S3FindFeature) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) DisabledStreamListener(ch.cyberduck.core.io.DisabledStreamListener) S3DefaultDeleteFeature(ch.cyberduck.core.s3.S3DefaultDeleteFeature) InputStream(java.io.InputStream) Local(ch.cyberduck.core.Local) Host(ch.cyberduck.core.Host) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) CryptoAttributesFeature(ch.cyberduck.core.cryptomator.features.CryptoAttributesFeature) DisabledTransferPrompt(ch.cyberduck.core.transfer.DisabledTransferPrompt) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) Transfer(ch.cyberduck.core.transfer.Transfer) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) S3ReadFeature(ch.cyberduck.core.s3.S3ReadFeature) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) TransferSpeedometer(ch.cyberduck.core.transfer.TransferSpeedometer) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) TransferItem(ch.cyberduck.core.transfer.TransferItem) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) IntegrationTest(ch.cyberduck.test.IntegrationTest) Test(org.junit.Test)

Example 4 with DefaultLocalDirectoryFeature

use of ch.cyberduck.core.local.DefaultLocalDirectoryFeature in project cyberduck by iterate-ch.

the class ProtocolFactory method register.

/**
 * Register profile and copy to application support directory
 *
 * @param file Connection profile to install
 * @return Installation location in application support directory
 */
public Local register(final Local file) {
    try {
        final Profile profile = new ProfilePlistReader(this).read(file);
        if (null == profile) {
            log.error("Attempt to register unknown protocol");
            return null;
        }
        if (log.isInfoEnabled()) {
            log.info(String.format("Register profile %s", profile));
        }
        registered.add(profile);
        preferences.setProperty(StringUtils.lowerCase(String.format("profiles.%s.%s.enabled", profile.getProtocol(), profile.getProvider())), true);
        if (!profiles.exists()) {
            new DefaultLocalDirectoryFeature().mkdir(profiles);
        }
        if (log.isDebugEnabled()) {
            log.debug(String.format("Save profile %s to %s", profile, profiles));
        }
        if (!file.isChild(profiles)) {
            final Local target = LocalFactory.get(profiles, file.getName());
            file.copy(target);
            return target;
        }
        return file;
    } catch (AccessDeniedException e) {
        log.error(String.format("Failure %s reading profile %s", e, file));
        return null;
    }
}
Also used : AccessDeniedException(ch.cyberduck.core.exception.AccessDeniedException) DefaultLocalDirectoryFeature(ch.cyberduck.core.local.DefaultLocalDirectoryFeature) ProfilePlistReader(ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader)

Example 5 with DefaultLocalDirectoryFeature

use of ch.cyberduck.core.local.DefaultLocalDirectoryFeature in project cyberduck by iterate-ch.

the class DownloadTransfer method transfer.

@Override
public void transfer(final Session<?> source, final Session<?> destination, final Path file, final Local local, final TransferOptions options, final TransferStatus overall, final TransferStatus segment, final ConnectionCallback connectionCallback, final ProgressListener listener, final StreamListener streamListener) throws BackgroundException {
    if (log.isDebugEnabled()) {
        log.debug(String.format("Transfer file %s with options %s", file, options));
    }
    if (file.isSymbolicLink()) {
        if (symlinkResolver.resolve(file)) {
            // Make relative symbolic link
            final String target = symlinkResolver.relativize(file.getAbsolute(), file.getSymlinkTarget().getAbsolute());
            if (log.isDebugEnabled()) {
                log.debug(String.format("Create symbolic link from %s to %s", local, target));
            }
            final Symlink symlink = LocalSymlinkFactory.get();
            symlink.symlink(local, target);
            return;
        }
    }
    if (file.isFile()) {
        listener.message(MessageFormat.format(LocaleFactory.localizedString("Downloading {0}", "Status"), file.getName()));
        final Local folder = local.getParent();
        if (!folder.exists()) {
            new DefaultLocalDirectoryFeature().mkdir(folder);
        }
        // Transfer
        final Download download = source.getFeature(Download.class);
        download.download(file, local, bandwidth, new DownloadStreamListener(this, this.options.icon && segment.getLength() > PreferencesFactory.get().getLong("queue.download.icon.threshold") && !overall.isSegmented() ? new IconUpdateStreamListener(streamListener, segment, local) : streamListener), segment, connectionCallback);
    } else if (file.isDirectory()) {
        if (!segment.isExists()) {
            listener.message(MessageFormat.format(LocaleFactory.localizedString("Making directory {0}", "Status"), local.getName()));
            new DefaultLocalDirectoryFeature().mkdir(local);
            segment.setComplete();
        }
    }
}
Also used : Symlink(ch.cyberduck.core.local.features.Symlink) DefaultLocalDirectoryFeature(ch.cyberduck.core.local.DefaultLocalDirectoryFeature) Download(ch.cyberduck.core.features.Download) IconUpdateStreamListener(ch.cyberduck.core.transfer.download.IconUpdateStreamListener)

Aggregations

DefaultLocalDirectoryFeature (ch.cyberduck.core.local.DefaultLocalDirectoryFeature)25 Test (org.junit.Test)17 Local (ch.cyberduck.core.Local)15 Path (ch.cyberduck.core.Path)14 Transfer (ch.cyberduck.core.transfer.Transfer)14 Host (ch.cyberduck.core.Host)13 TestProtocol (ch.cyberduck.core.TestProtocol)13 DisabledNotificationService (ch.cyberduck.core.notification.DisabledNotificationService)13 TransferItem (ch.cyberduck.core.transfer.TransferItem)13 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)13 UploadTransfer (ch.cyberduck.core.transfer.UploadTransfer)13 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)12 Delete (ch.cyberduck.core.features.Delete)12 DisabledStreamListener (ch.cyberduck.core.io.DisabledStreamListener)12 DisabledTransferErrorCallback (ch.cyberduck.core.transfer.DisabledTransferErrorCallback)12 DisabledTransferPrompt (ch.cyberduck.core.transfer.DisabledTransferPrompt)12 TransferAction (ch.cyberduck.core.transfer.TransferAction)12 TransferOptions (ch.cyberduck.core.transfer.TransferOptions)12 TransferSpeedometer (ch.cyberduck.core.transfer.TransferSpeedometer)12 SingleTransferWorker (ch.cyberduck.core.worker.SingleTransferWorker)12