Cyberduck Mountain Duck CLI

Changeset 41248


Ignore:
Timestamp:
Jun 6, 2017 2:51:38 PM (14 months ago)
Author:
dkocher
Message:

Merge remote-tracking branch 'origin/master'

Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/CryptoVault.java

    r41208 r41248  
    8585    private static final Pattern BASE32_PATTERN = Pattern.compile("^0?(([A-Z2-7]{8})*[A-Z2-7=]{8})");
    8686
     87    private final PasswordStore keychain;
     88
    8789    /**
    8890     * Root of vault directory
    8991     */
    90     private final Path home;
    91     private final PasswordStore keychain;
    92 
     92    private Path home;
    9393    private Cryptor cryptor;
    9494
     
    123123        }
    124124        // Obtain non encrypted directory writer
    125         final Directory feature = session._getFeature(Directory.class);
    126         feature.mkdir(home, region, new TransferStatus());
     125        final Directory directory = session._getFeature(Directory.class);
     126        home = directory.mkdir(home, region, new TransferStatus());
    127127        new ContentWriter(session).write(masterKeyFile, masterKeyFileContent.serialize());
    128128        this.open(KeyFile.parse(masterKeyFileContent.serialize()), passphrase);
     
    133133            log.debug(String.format("Create vault root directory at %s", secondLevel));
    134134        }
    135         feature.mkdir(dataDir, region, new TransferStatus());
    136         feature.mkdir(firstLevel, region, new TransferStatus());
    137         feature.mkdir(secondLevel, region, new TransferStatus());
     135        directory.mkdir(dataDir, region, new TransferStatus());
     136        directory.mkdir(firstLevel, region, new TransferStatus());
     137        directory.mkdir(secondLevel, region, new TransferStatus());
    138138        return this;
    139139    }
  • trunk/onedrive/src/main/java/ch/cyberduck/core/onedrive/OneDriveContainerListService.java

    r40738 r41248  
    2323import ch.cyberduck.core.exception.BackgroundException;
    2424
     25import org.apache.log4j.Logger;
    2526import org.nuxeo.onedrive.client.OneDriveDrive;
    2627import org.nuxeo.onedrive.client.OneDriveDrivesIterator;
     
    3334 */
    3435public class OneDriveContainerListService implements RootListService {
     36    private static final Logger log = Logger.getLogger(OneDriveContainerListService.class);
    3537
    3638    private final OneDriveSession session;
     
    4345    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
    4446        final AttributedList<Path> children = new AttributedList<>();
    45         try {
    46             // In most cases, OneDrive and OneDrive for Business users will only have a single
    47             // drive available, the default drive. When using OneDrive API with a SharePoint team site,
    48             // this API returns the collection of document libraries created in the site.
    49             final OneDriveDrivesIterator iter = new OneDriveDrivesIterator(session.getClient());
    50             while(iter.hasNext()) {
    51                 try {
    52                     final OneDriveDrive.Metadata metadata = iter.next();
    53                     final PathAttributes attributes = new PathAttributes();
    54                     attributes.setSize(metadata.getTotal());
    55                     children.add(new Path(directory, metadata.getId(), EnumSet.of(Path.Type.directory, Path.Type.volume), attributes));
    56                     listener.chunk(directory, children);
    57                 }
    58                 catch(OneDriveRuntimeException e) {
    59                     throw new OneDriveExceptionMappingService().map(e.getCause());
    60                 }
     47        // In most cases, OneDrive and OneDrive for Business users will only have a single
     48        // drive available, the default drive. When using OneDrive API with a SharePoint team site,
     49        // this API returns the collection of document libraries created in the site.
     50        final OneDriveDrivesIterator iter = new OneDriveDrivesIterator(session.getClient());
     51        while(iter.hasNext()) {
     52            final OneDriveDrive.Metadata metadata;
     53            try {
     54                metadata = iter.next();
    6155            }
    62         }
    63         catch(OneDriveRuntimeException e) { // this catches iterator.hasNext() which in return should fail fast
    64             throw new OneDriveExceptionMappingService().map("Listing directory {0} failed", e.getCause(), directory);
     56            catch(OneDriveRuntimeException e) {
     57                log.warn(e.getMessage());
     58                continue;
     59            }
     60            final PathAttributes attributes = new PathAttributes();
     61            attributes.setSize(metadata.getTotal());
     62            children.add(new Path(directory, metadata.getId(), EnumSet.of(Path.Type.directory, Path.Type.volume), attributes));
     63            listener.chunk(directory, children);
    6564        }
    6665        return children;
  • trunk/onedrive/src/main/java/ch/cyberduck/core/onedrive/OneDriveItemListService.java

    r41245 r41248  
    6767                }
    6868                catch(OneDriveRuntimeException e) {
    69                     log.warn(e);
     69                    log.warn(e.getMessage());
    7070                    continue;
    7171                }
  • trunk/onedrive/src/main/java/ch/cyberduck/core/onedrive/OneDriveListService.java

    r40738 r41248  
    2222import ch.cyberduck.core.exception.BackgroundException;
    2323
    24 import org.nuxeo.onedrive.client.OneDriveRuntimeException;
    25 
    2624public class OneDriveListService implements ListService {
    2725
     
    3432    @Override
    3533    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
    36         try {
    37             if(directory.isRoot()) {
    38                 return new OneDriveContainerListService(session).list(directory, listener);
    39             }
    40             else {
    41                 return new OneDriveItemListService(session).list(directory, listener);
    42             }
     34        if(directory.isRoot()) {
     35            return new OneDriveContainerListService(session).list(directory, listener);
    4336        }
    44         catch(OneDriveRuntimeException e) { // this catches iterator.hasNext() which in return should fail fast
    45             throw new OneDriveExceptionMappingService().map("Listing directory {0} failed", e.getCause(), directory);
     37        else {
     38            return new OneDriveItemListService(session).list(directory, listener);
    4639        }
    4740    }
Note: See TracChangeset for help on using the changeset viewer.
swiss made software