@Override public DescriptiveUrlBag toUrl(final Path file) { return DescriptiveUrlBag.empty(); } }
@Override public DescriptiveUrlBag toUrl(final Path file) { final Path container = containerService.getContainer(file); if(distributions.containsKey(container)) { return new DistributionUrlProvider(distributions.get(container)).toUrl(file); } return DescriptiveUrlBag.empty(); }
@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(); }
if(!accounts.containsKey(region)) { log.warn(String.format("No account info for region %s available required to sign temporary URL", region)); return DescriptiveUrlBag.empty(); if(StringUtils.isBlank(info.getTempUrlKey())) { log.warn("Missing X-Account-Meta-Temp-URL-Key header value to sign temporary URL"); return DescriptiveUrlBag.empty();
@Override public DescriptiveUrlBag toUrl(final Path file) { try { final DescriptiveUrlBag set = delegate.toUrl(file); final Path encrypt = vault.encrypt(session, file); set.add(new DescriptiveUrl(URI.create(String.format("%s%s", new HostUrlProvider().withUsername(false).get(session.getHost()), URIEncoder.encode(encrypt.getAbsolute()))), DescriptiveUrl.Type.encrypted, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Encrypted", "Cryptomator"))) ); return set; } catch(BackgroundException e) { log.warn(String.format("Failure encrypting filename. %s", e.getMessage())); return DescriptiveUrlBag.empty(); } }
@Override public DescriptiveUrlBag toUrl(final Path file) { if(file.isVolume()) { return DescriptiveUrlBag.empty(); } final DescriptiveUrlBag list = new DescriptiveUrlBag(); if(file.isFile()) { final String download = String.format("%s/file/%s/%s", session.getClient().getDownloadUrl(), URIEncoder.encode(containerService.getContainer(file).getName()), URIEncoder.encode(containerService.getKey(file))); list.add(new DescriptiveUrl(URI.create(download), DescriptiveUrl.Type.http, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), Scheme.https.name().toUpperCase(Locale.ROOT)))); } return list; } }
@Override public DescriptiveUrlBag toUrl(final Path file) { final String nodeid = file.isDirectory() ? file.attributes().getVersionId() : file.getParent().attributes().getVersionId(); if(StringUtils.isBlank(nodeid)) { return DescriptiveUrlBag.empty(); } return new DescriptiveUrlBag(Collections.singletonList( new DescriptiveUrl(URI.create(String.format("%s/#/node/%s", new HostUrlProvider().withUsername(false).get(session.getHost()), URIEncoder.encode( nodeid ))), DescriptiveUrl.Type.http, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), session.getHost().getProtocol().getScheme().toString().toUpperCase(Locale.ROOT))) )); } }