Tabnine Logo
PathContainerService
Code IndexAdd Tabnine to your IDE (free)

How to use
PathContainerService
in
ch.cyberduck.core

Best Java code snippets using ch.cyberduck.core.PathContainerService (Showing top 20 results out of 315)

origin: iterate-ch/cyberduck

@Override
public Acl getPermission(final Path file) {
  if(containerService.isContainer(file)) {
    return containerService.getContainer(file).attributes().getAcl();
  }
  return Acl.EMPTY;
}
origin: iterate-ch/cyberduck

  protected String createPrefix(final Path directory) {
    // Keys can be listed by prefix. By choosing a common prefix
    // for the names of related keys and marking these keys with
    // a special character that delimits hierarchy, you can use the list
    // operation to select and browse keys hierarchically
    String prefix = StringUtils.EMPTY;
    if(!containerService.isContainer(directory)) {
      // Restricts the response to only contain results that begin with the
      // specified prefix. If you omit this optional argument, the value
      // of Prefix for your query will be the empty string.
      // In other words, the results will be not be restricted by prefix.
      prefix = containerService.getKey(directory);
      if(!prefix.endsWith(String.valueOf(Path.DELIMITER))) {
        prefix += Path.DELIMITER;
      }
    }
    return prefix;
  }
}
origin: iterate-ch/cyberduck

private Map<Path, Boolean> getRoomEncryptionStatus(final Map<TransferItem, TransferStatus> files) throws BackgroundException {
  final Map<Path, Boolean> rooms = new HashMap<>();
  for(Map.Entry<TransferItem, TransferStatus> entry : files.entrySet()) {
    // Get top level room
    final Path container = new PathContainerService().getContainer(entry.getKey().remote);
    if(rooms.containsKey(container)) {
      continue;
    }
    rooms.put(container, nodeid.isEncrypted(entry.getKey().remote));
  }
  return rooms;
}
origin: iterate-ch/cyberduck

/**
 * Properly URI encode and prepend the bucket name.
 *
 * @param scheme Protocol
 * @return URL to be displayed in browser
 */
protected DescriptiveUrl toUrl(final Path file, final Scheme scheme) {
  final StringBuilder url = new StringBuilder(scheme.name());
  url.append("://");
  if(file.isRoot()) {
    url.append(session.getHost().getHostname());
  }
  else {
    final String hostname = this.getHostnameForContainer(containerService.getContainer(file));
    if(hostname.startsWith(containerService.getContainer(file).getName())) {
      url.append(hostname);
      if(!containerService.isContainer(file)) {
        url.append(Path.DELIMITER);
        url.append(URIEncoder.encode(containerService.getKey(file)));
      }
    }
    else {
      url.append(session.getHost().getHostname());
      url.append(URIEncoder.encode(file.getAbsolute()));
    }
  }
  return new DescriptiveUrl(URI.create(url.toString()), DescriptiveUrl.Type.http,
    MessageFormat.format(LocaleFactory.localizedString("{0} URL"), scheme.name().toUpperCase(Locale.ROOT)));
}
origin: iterate-ch/cyberduck

protected String copy(final Path source, final S3Object destination, final TransferStatus status) throws BackgroundException {
  try {
    // Copying object applying the metadata of the original
    final Map<String, Object> stringObjectMap = session.getClient().copyVersionedObject(source.attributes().getVersionId(), containerService.getContainer(source).getName(),
      containerService.getKey(source),
      destination.getBucketName(), destination, false);
    final Map complete = (Map) stringObjectMap.get(Constants.KEY_FOR_COMPLETE_METADATA);
    return (String) complete.get(Constants.AMZ_VERSION_ID);
  }
  catch(ServiceException e) {
    throw new S3ExceptionMappingService().map("Cannot copy {0}", e, source);
  }
}
origin: iterate-ch/cyberduck

  @Override
  public boolean isSupported(final Path source, final Path target) {
    return !containerService.isContainer(source) && !containerService.isContainer(target);
  }
}
origin: iterate-ch/cyberduck

protected Set<Path> getContainers(final List<Path> files) {
  final Set<Path> containers = new HashSet<>();
  for(Path file : files) {
    containers.add(containerService.getContainer(file));
  }
  return containers;
}
origin: iterate-ch/cyberduck

public DefaultPathPredicate(final Path file) {
  final Path.Type type = file.isSymbolicLink() ? Path.Type.symboliclink : file.isFile() ? Path.Type.file : Path.Type.directory;
  String qualifier = StringUtils.EMPTY;
  if(StringUtils.isNotBlank(file.attributes().getRegion())) {
    if(new PathContainerService().isContainer(file)) {
      qualifier += file.attributes().getRegion();
    }
  }
  if(file.isFile()) {
    if(StringUtils.isNotBlank(file.attributes().getVersionId())) {
      qualifier += file.attributes().getVersionId();
    }
  }
  final String path = file.getAbsolute();
  reference = "[" + type + "]" + "-" + qualifier + path;
}
origin: iterate-ch/cyberduck

  @Override
  public String getKey(final Path file) {
    final String key = super.getKey(file);
    if(!file.isRoot() && !this.isContainer(file) && file.isDirectory()) {
      return key.concat(String.valueOf(Path.DELIMITER)).concat(PLACEHOLDER);
    }
    return key;
  }
}
origin: iterate-ch/cyberduck

  public SwiftHomeFinderService(final SwiftSession session) {
    super(session, new PathContainerService());
  }
}
origin: iterate-ch/cyberduck

@Override
public void setMetadata(final Path file, final Map<String, String> metadata) throws BackgroundException {
  try {
    if(containerService.isContainer(file)) {
      for(Map.Entry<String, String> entry : file.attributes().getMetadata().entrySet()) {
          containerService.getContainer(file).getName(), metadata);
          containerService.getContainer(file).getName(), containerService.getKey(file), metadata);
origin: iterate-ch/cyberduck

final String manifest = segmentService.manifest(containerService.getContainer(file).getName(), completed);
if(log.isDebugEnabled()) {
  log.debug(String.format("Creating SLO manifest %s for %s", manifest, file));
    containerService.getContainer(file)),
    containerService.getContainer(file).getName(),
    overall.getMime(),
    containerService.getKey(file), manifest, Collections.emptyMap());
origin: iterate-ch/cyberduck

  @Override
  public boolean isSupported(final Path source, final Path target) {
    return !containerService.isContainer(source) && !containerService.isContainer(target);
  }
}
origin: iterate-ch/cyberduck

@Override
public DescriptiveUrlBag toUrl(final Path file) {
  if(distributions.containsKey(containerService.getContainer(file))) {
    return new DistributionUrlProvider(distributions.get(containerService.getContainer(file))).toUrl(file);
  }
  return DescriptiveUrlBag.empty();
}
origin: iterate-ch/cyberduck

@Override
public PathAttributes find(final Path file) throws BackgroundException {
  if(file.isRoot()) {
    return PathAttributes.EMPTY;
  }
  if(new PathContainerService().isContainer(file)) {
    return PathAttributes.EMPTY;
  }
  final AttributedList<Path> list = new FileidDriveListService(session, fileid, file).list(file.getParent(), new DisabledListProgressListener());
  final Path found = list.find(new DriveFileidProvider.IgnoreTrashedPathPredicate(file));
  if(null == found) {
    throw new NotfoundException(file.getAbsolute());
  }
  return found.attributes();
}
origin: iterate-ch/cyberduck

/**
 * @param file   File in origin container
 * @param origin Distribution URL
 * @return URL to file in distribution
 */
private URI toUrl(final Path file, final URI origin) {
  final StringBuilder b = new StringBuilder(String.format("%s://%s", origin.getScheme(), origin.getHost()));
  if(distribution.getMethod().equals(Distribution.CUSTOM)) {
    b.append(Path.DELIMITER).append(URIEncoder.encode(PathRelativizer.relativize(origin.getRawPath(), file.getAbsolute())));
  }
  else {
    if(StringUtils.isNotEmpty(origin.getRawPath())) {
      b.append(origin.getRawPath());
    }
    if(StringUtils.isNotEmpty(containerService.getKey(file))) {
      b.append(Path.DELIMITER).append(URIEncoder.encode(containerService.getKey(file)));
    }
  }
  return URI.create(b.toString()).normalize();
}
origin: iterate-ch/cyberduck

final AttributedList<Path> objects = new AttributedList<Path>();
Marker marker;
if(containerService.isContainer(directory)) {
  marker = new Marker(null, null);
  marker = new Marker(String.format("%s%s", containerService.getKey(directory), Path.DELIMITER), null);
final String containerId = fileid.getFileid(containerService.getContainer(directory), new DisabledListProgressListener());
    containerId,
    marker.nextFilename, marker.nextFileId, chunksize,
    containerService.isContainer(directory) ? null : String.format("%s%s", containerService.getKey(directory), String.valueOf(Path.DELIMITER)),
    String.valueOf(Path.DELIMITER));
  marker = this.parse(directory, objects, response, revisions);
origin: iterate-ch/cyberduck

@Override
public Algorithm getEncryption(final Path file) throws BackgroundException {
  if(containerService.isContainer(file)) {
    final String key = String.format("s3.encryption.key.%s", containerService.getContainer(file).getName());
    if(StringUtils.isNotBlank(preferences.getProperty(key))) {
      return Algorithm.fromString(preferences.getProperty(key));
    }
  }
  return super.getEncryption(file);
}
origin: iterate-ch/cyberduck

  @Override
  public InputStream open() throws IOException {
    try {
      return session.getClient().getObjectImpl(
        false,
        containerService.getContainer(file).getName(),
        containerService.getKey(file),
        null,
        null,
        null,
        null,
        null,
        null,
        file.attributes().getVersionId(),
        new HashMap<String, Object>(),
        chunk.getParameters())
        .getDataInputStream();
    }
    catch(ServiceException e) {
      throw new IOException(e.getMessage(), e);
    }
  }
});
origin: iterate-ch/cyberduck

  @Override
  public boolean isSupported(final Path source, final Path target) {
    return !containerService.isContainer(source) && !containerService.isContainer(target);
  }
}
ch.cyberduck.corePathContainerService

Most used methods

  • isContainer
  • getContainer
  • getKey
  • <init>

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • setScale (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now