本文整理了Java中ch.cyberduck.core.Path.attributes()
方法的一些代码示例,展示了Path.attributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.attributes()
方法的具体详情如下:
包路径:ch.cyberduck.core.Path
类名称:Path
方法名:attributes
[英]Attributes denoting this path
[中]表示此路径的属性
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Path file) {
if(file.attributes().isDuplicate()) {
if(log.isDebugEnabled()) {
log.debug(String.format("Reject duplicate %s", file));
}
return false;
}
return true;
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
protected int compareFirst(final Path p1, final Path p2) {
if(p1.attributes().getSize() > p2.attributes().getSize()) {
return ascending ? 1 : -1;
}
else if(p1.attributes().getSize() < p2.attributes().getSize()) {
return ascending ? -1 : 1;
}
return 0;
}
}
代码示例来源:origin: iterate-ch/cyberduck
private Path toDecrypted(final Path file) {
if(file.getType().contains(Path.Type.encrypted)) {
if(null == file.attributes().getDecrypted()) {
log.error(String.format("Missing decrypted reference for %s", file));
}
return file.attributes().getDecrypted();
}
return file;
}
代码示例来源:origin: iterate-ch/cyberduck
public WritePermissionWorker(final List<Path> files,
final PermissionOverwrite overwrite,
final RecursiveCallback<Permission> callback,
final ProgressListener listener) {
this.files = files;
this.permissions = new HashMap<>();
for(Path f : files) {
this.permissions.put(f, overwrite.resolve(f.attributes().getPermission()));
}
this.callback = callback;
this.listener = listener;
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public Long run(final Session<?> session) throws BackgroundException {
for(Path next : files) {
next.attributes().setSize(this.calculateSize(session, next));
}
return total;
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public DescriptiveUrlBag toUrl(final Path file) {
final DescriptiveUrlBag list = new DescriptiveUrlBag();
if(file.attributes().getLink() != null) {
list.add(file.attributes().getLink());
}
return list;
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean test(final Path test) {
if(test.attributes().isDuplicate()) {
// Ignore trashed files
return false;
}
return super.test(test);
}
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param workdir Working directory in browser
* @param name Folder name or null if unknown
* @return True if creating directory will succeed
*/
default boolean isSupported(Path workdir, String name) {
return workdir.attributes().getPermission().isWritable();
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getTooltip(final Path file) {
return sizeFormatter.format(file.attributes().getSize(), true);
}
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param workdir Working directory
* @return True if creating an empty file is possible.
*/
default boolean isSupported(Path workdir) {
return workdir.attributes().getPermission().isWritable();
}
代码示例来源:origin: iterate-ch/cyberduck
protected void setObjectValueForItem(final Path item, final NSObject value, final String identifier) {
if(log.isDebugEnabled()) {
log.debug(String.format("Set new value %s for item %s", value, item));
}
if(identifier.equals(BrowserColumn.filename.name())) {
if(StringUtils.isNotBlank(value.toString()) && !item.getName().equals(value.toString())) {
final Path renamed = new Path(item.getParent(), value.toString(), item.getType(), item.attributes());
new MoveController(controller).rename(item, renamed);
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean isSupported(final Path source, final Path target) {
if(Boolean.valueOf(containerService.getContainer(source).attributes().getCustom().get(SDSAttributesFinderFeature.KEY_ENCRYPTED))
^ Boolean.valueOf(containerService.getContainer(target).attributes().getCustom().get(SDSAttributesFinderFeature.KEY_ENCRYPTED))) {
return session.getFeature(Copy.class).isSupported(source, target);
}
return proxy.isSupported(source, target);
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public DescriptiveUrlBag toUrl(final Path file) {
final DescriptiveUrlBag list = new DescriptiveUrlBag();
if(file.isFile()) {
if(file.attributes().getLink() != null) {
list.add(file.attributes().getLink());
}
}
return list;
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public ChecksumCompute checksum(final Path file) {
if(Boolean.valueOf(containerService.getContainer(file).attributes().getCustom().get(SDSAttributesFinderFeature.KEY_ENCRYPTED))) {
return new CryptoWriteFeature(session, proxy).checksum(file);
}
return proxy.checksum(file);
}
}
代码示例来源: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
/**
* @param source Source file or folder
* @param target Target file or folder
* @return False if not supported for given files
*/
default boolean isSupported(Path source, Path target) {
return target.getParent().attributes().getPermission().isWritable();
}
代码示例来源:origin: iterate-ch/cyberduck
private Path inflate(final Session<?> session, final Path file) throws BackgroundException {
final String fileName = file.getName();
if(filenameProvider.isDeflated(fileName)) {
final String filename = filenameProvider.inflate(session, fileName);
return new Path(file.getParent(), filename, EnumSet.of(Path.Type.file), file.attributes());
}
return file;
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
final Path copy = new SwiftCopyFeature(session, regionService).copy(file, renamed, new TransferStatus().length(file.attributes().getSize()), connectionCallback);
delete.delete(Collections.singletonList(file), connectionCallback, callback);
return copy;
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
final GroupItem group = new GroupItem(session.getClient(), directory.attributes().getVersionId());
final GroupDrivesIterator iterator = new GroupDrivesIterator(session.getClient(), group);
return this.iterate(iterator, directory, listener);
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public Path touch(final Path file, final TransferStatus status) throws BackgroundException {
// Write header
final Cryptor cryptor = vault.getCryptor();
final FileHeader header = cryptor.fileHeaderCryptor().create();
status.setHeader(cryptor.fileHeaderCryptor().encryptHeader(header));
status.setNonces(new RandomNonceGenerator());
final Path target = proxy.touch(vault.encrypt(session, file), status);
final Path decrypt = vault.decrypt(session, target);
decrypt.attributes().withVersionId(target.attributes().getVersionId());
return decrypt;
}
内容来源于网络,如有侵权,请联系作者删除!