ch.cyberduck.core.Local.getAbbreviatedPath()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中ch.cyberduck.core.Local.getAbbreviatedPath()方法的一些代码示例,展示了Local.getAbbreviatedPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Local.getAbbreviatedPath()方法的具体详情如下:
包路径:ch.cyberduck.core.Local
类名称:Local
方法名:getAbbreviatedPath

Local.getAbbreviatedPath介绍

暂无

代码示例

代码示例来源:origin: iterate-ch/cyberduck

public String getLocal() {
  final Local local = roots.iterator().next().local;
  if(roots.size() == 1) {
    return local.getAbbreviatedPath();
  }
  else {
    return local.getParent().getAbbreviatedPath();
  }
}

代码示例来源:origin: iterate-ch/cyberduck

String passphrase = this.getPassword(bookmark.getHostname(), key.getAbbreviatedPath());
if(null == passphrase) {
  passphrase = this.getPassword("SSHKeychain", key.getAbbreviatedPath());

代码示例来源:origin: iterate-ch/cyberduck

builder.append(String.format("Third party connection profiles. Install additional connection profiles in %s",
  LocalFactory.get(SupportDirectoryFinderFactory.get().find(),
    PreferencesFactory.get().getProperty("profiles.folder.name")).getAbbreviatedPath()));
builder.append(StringUtils.LF);
for(Protocol p : protocols.find(new ProfileProtocolPredicate())) {

代码示例来源:origin: iterate-ch/cyberduck

if(StringUtils.isNotBlank(credentials.getPassword())) {
  if(credentials.isPublicKeyAuthentication()) {
    keychain.addPassword(bookmark.getHostname(), credentials.getIdentity().getAbbreviatedPath(),
        credentials.getPassword());

代码示例来源:origin: iterate-ch/cyberduck

@Override
public char[] reqPassword(Resource<?> resource) {
  if(StringUtils.isEmpty(credentials.getIdentityPassphrase())) {
    try {
      // Use password prompt
      final Credentials input = prompt.prompt(bookmark,
        LocaleFactory.localizedString("Private key password protected", "Credentials"),
        String.format("%s (%s)",
          LocaleFactory.localizedString("Enter the passphrase for the private key file", "Credentials"),
          identity.getAbbreviatedPath()),
        new LoginOptions()
          .icon(bookmark.getProtocol().disk())
          .user(false).password(true)
      );
      credentials.setSaved(input.isSaved());
      credentials.setIdentityPassphrase(input.getPassword());
    }
    catch(LoginCanceledException e) {
      canceled.set(true);
      // Return null if user cancels
      return StringUtils.EMPTY.toCharArray();
    }
  }
  return credentials.getIdentityPassphrase().toCharArray();
}

代码示例来源:origin: iterate-ch/cyberduck

protected Credentials prompt(final LoginOptions options, final Credentials credentials) {
    if(options.save && options.keychain) {
      if(!PreferencesFactory.get().getBoolean("keychain.secure")) {
        console.printf(String.format("WARNING! Passwords are stored in plain text in %s.",
          LocalFactory.get(SupportDirectoryFinderFactory.get().find(), "credentials").getAbbreviatedPath()));
      }
      credentials.setSaved(prompt.prompt(LocaleFactory.get().localize("Save password", "Credentials")));
    }
    else {
      credentials.setSaved(options.save);
    }
    return credentials;
  }
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
public char[] reqPassword(Resource<?> resource) {
  if(StringUtils.isEmpty(credentials.getIdentityPassphrase())) {
    try {
      // Use password prompt
      final Credentials input = prompt.prompt(bookmark,
        LocaleFactory.localizedString("Private key password protected", "Credentials"),
        String.format("%s (%s)",
          LocaleFactory.localizedString("Enter the passphrase for the private key file", "Credentials"),
          identity.getAbbreviatedPath()),
        new LoginOptions()
          .icon(bookmark.getProtocol().disk())
          .user(false).password(true)
      );
      credentials.setSaved(input.isSaved());
      credentials.setIdentityPassphrase(input.getPassword());
    }
    catch(LoginCanceledException e) {
      // Return null if user cancels
      return StringUtils.EMPTY.toCharArray();
    }
  }
  config.setPassword(credentials.getIdentityPassphrase());
  return credentials.getIdentityPassphrase().toCharArray();
}

代码示例来源:origin: iterate-ch/cyberduck

dict.setStringForKey(credentials.getIdentity().getAbbreviatedPath(), "Private Key File");
dict.setObjectForKey(credentials.getIdentity(), "Private Key File Dictionary");
dict.setStringForKey(downloadFolder.getAbbreviatedPath(), "Download Folder");
dict.setObjectForKey(downloadFolder, "Download Folder Dictionary");
dict.setStringForKey(String.valueOf(volume.getAbbreviatedPath()), "Volume");

代码示例来源:origin: iterate-ch/cyberduck

this.addPassword(bookmark.getHostname(), credentials.getIdentity().getAbbreviatedPath(),
  credentials.getIdentityPassphrase());

代码示例来源:origin: iterate-ch/cyberduck

private void addDownloadPath(final Local f) {
  this.downloadPathPopup.addItemWithTitle(f.getDisplayName());
  this.downloadPathPopup.lastItem().setImage(
    IconCacheFactory.<NSImage>get().fileIcon(f, 16)
  );
  this.downloadPathPopup.lastItem().setRepresentedObject(f.getAbbreviatedPath());
  if(DEFAULT_DOWNLOAD_FOLDER.equals(f)) {
    this.downloadPathPopup.selectItem(this.downloadPathPopup.lastItem());
  }
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
  public void run() {
    final NSOpenPanel panel = NSOpenPanel.openPanel();
    panel.setCanChooseDirectories(file.isDirectory());
    panel.setCanChooseFiles(file.isFile());
    panel.setAllowsMultipleSelection(false);
    panel.setMessage(MessageFormat.format(LocaleFactory.localizedString("Select {0}", "Credentials"),
      file.getAbbreviatedPath()));
    panel.setPrompt(LocaleFactory.localizedString("Choose"));
    final NSInteger modal = panel.runModal(file.getParent().getAbsolute(), file.getName());
    if(modal.intValue() == SheetCallback.DEFAULT_OPTION) {
      final NSArray filenames = panel.filenames();
      final NSEnumerator enumerator = filenames.objectEnumerator();
      NSObject next;
      while((next = enumerator.nextObject()) != null) {
        selected.set(new FinderLocal(next.toString()));
      }
    }
    panel.orderOut(null);
  }
};

代码示例来源:origin: iterate-ch/cyberduck

if(file.getType().contains(Path.Type.file)) {
  if(local.isDirectory()) {
    throw new LocalAccessDeniedException(String.format("Cannot replace folder %s with file %s", local.getAbbreviatedPath(), file.getName()));
    throw new LocalAccessDeniedException(String.format("Cannot replace file %s with folder %s", local.getAbbreviatedPath(), file.getName()));

代码示例来源:origin: iterate-ch/cyberduck

public void downloadPathPanelDidEnd_returnCode_contextInfo(NSOpenPanel sheet, int returncode, ID contextInfo) {
  if(returncode == SheetCallback.DEFAULT_OPTION) {
    NSArray selected = sheet.filenames();
    String filename;
    if((filename = selected.lastObject().toString()) != null) {
      final Local folder = LocalFactory.get(filename);
      preferences.setProperty("queue.download.folder", folder.getAbbreviatedPath());
      preferences.setProperty("queue.download.folder.bookmark", folder.getBookmark());
    }
  }
  final Local custom = LocalFactory.get(preferences.getProperty("queue.download.folder"));
  final NSMenuItem item = downloadPathPopup.itemAtIndex(new NSInteger(0));
  item.setTitle(custom.getDisplayName());
  item.setRepresentedObject(custom.getAbsolute());
  item.setImage(IconCacheFactory.<NSImage>get().fileIcon(custom, 16));
  downloadPathPopup.selectItem(item);
  downloadPathPanel = null;
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
  public void change(final Host bookmark) {
    privateKeyPopup.setEnabled(options.publickey);
    if(credentials.isPublicKeyAuthentication()) {
      privateKeyPopup.selectItemAtIndex(privateKeyPopup.indexOfItemWithRepresentedObject(credentials.getIdentity().getAbsolute()));
    }
    else {
      privateKeyPopup.selectItemWithTitle(LocaleFactory.localizedString("None"));
    }
    if(credentials.isPublicKeyAuthentication()) {
      final Local key = credentials.getIdentity();
      if(-1 == privateKeyPopup.indexOfItemWithRepresentedObject(key.getAbsolute()).intValue()) {
        final NSInteger index = new NSInteger(0);
        privateKeyPopup.insertItemWithTitle_atIndex(key.getAbbreviatedPath(), index);
        privateKeyPopup.itemAtIndex(index).setRepresentedObject(key.getAbsolute());
      }
    }
  }
});

代码示例来源:origin: iterate-ch/cyberduck

this.privateKeyPopup.menu().addItem(NSMenuItem.separatorItem());
for(Local key : new OpenSSHPrivateKeyConfigurator().list()) {
  this.privateKeyPopup.addItemWithTitle(key.getAbbreviatedPath());
  this.privateKeyPopup.lastItem().setRepresentedObject(key.getAbsolute());

相关文章