本文整理了Java中ch.cyberduck.core.Local.getName()
方法的一些代码示例,展示了Local.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Local.getName()
方法的具体详情如下:
包路径:ch.cyberduck.core.Local
类名称:Local
方法名:getName
暂无
代码示例来源:origin: iterate-ch/cyberduck
/**
* Subclasses may override to return a user friendly representation of the name denoting this path.
*
* @return Name of the file
* @see #getName()
*/
public String getDisplayName() {
return this.getName();
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return file.getName().endsWith(".cyberducktransfer");
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return file.getName().endsWith(".duck");
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return "receipt".equals(file.getName());
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return "cyberducklicense".equalsIgnoreCase(FilenameUtils.getExtension(file.getName()));
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return "cyberduckprofile".equals(FilenameUtils.getExtension(file.getName()));
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return "cyberduckreceipt".equals(FilenameUtils.getExtension(file.getName()));
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
return "qloudsonicvoucher".equals(FilenameUtils.getExtension(file.getName()));
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(final Local file) {
if(pattern.matcher(file.getName()).matches()) {
if(log.isDebugEnabled()) {
log.debug(String.format("Skip %s excluded with regex", file));
}
return false;
}
return true;
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean accept(Local file) {
if(file.isFile()) {
return "fireFTPsites.dat".equals(file.getName());
}
return false;
}
})) {
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getName() {
return LocaleFactory.localizedString(folder.getName());
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void trash(Local file) throws LocalAccessDeniedException {
try {
Files.delete(Paths.get(file.getAbsolute()));
}
catch(IOException e) {
throw new LocalAccessDeniedException(String.format("Failed to move %s to Trash", file.getName()), e);
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
protected boolean matches(final Local context, final Local file) {
if(!new File(context.getAbsolute()).isAbsolute()) {
return context.getName().equals(file.getName());
}
return this.normalize(context).equals(this.normalize(file));
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void mkdir(final Local file) throws AccessDeniedException {
try {
Files.createDirectories(Paths.get(file.getAbsolute()));
}
catch(IOException e) {
throw new LocalAccessDeniedException(MessageFormat.format(LocaleFactory.localizedString(
"Cannot create folder {0}", "Error"), file.getName()), e);
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* Delete the file
*/
public void delete() throws AccessDeniedException, NotfoundException {
try {
Files.delete(Paths.get(path));
}
catch(NoSuchFileException e) {
throw new LocalNotfoundException(String.format("Delete %s failed", path), e);
}
catch(IOException e) {
throw new LocalAccessDeniedException(MessageFormat.format(
LocaleFactory.localizedString("Cannot delete {0}", "Error"), this.getName()), e);
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void trash(final Local file) throws LocalAccessDeniedException {
try {
FileUtils.getInstance().moveToTrash(new File[]{new File(file.getAbsolute())});
}
catch(IOException e) {
log.warn(String.format("Failed to move %s to Trash", file.getName()));
new DefaultLocalTrashFeature().trash(file);
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getName() {
return this.getRoot().remote.getName()
+ " \u2194 " /*left-right arrow*/ + this.getRoot().local.getName();
}
代码示例来源:origin: iterate-ch/cyberduck
private void upload(final Host bookmark, final List<Local> files, final Path destination) {
final List<TransferItem> roots = new ArrayList<TransferItem>();
for(Local file : files) {
roots.add(new TransferItem(new Path(destination, file.getName(),
file.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), file));
}
final TransferController t = TransferControllerFactory.get();
t.start(new UploadTransfer(bookmark, roots), new TransferOptions());
}
代码示例来源:origin: iterate-ch/cyberduck
protected TransferItem resolve(final Path remote, final Local local) {
if(local.isDirectory()) {
// Local path resolves to folder
if(remote.isDirectory()) {
// Append local name to remote target
return new TransferItem(new Path(remote, local.getName(), EnumSet.of(Path.Type.directory)), local);
}
return new TransferItem(new Path(remote.getParent(), remote.getName(), EnumSet.of(Path.Type.directory)), local);
}
// Local path resolves to file
if(remote.isDirectory()) {
// Append local name to remote target
return new TransferItem(new Path(remote, local.getName(), EnumSet.of(Path.Type.file)), local);
}
// Keep from input for file transfer
return new TransferItem(remote, local);
}
}
代码示例来源:origin: iterate-ch/cyberduck
private FileKeyProvider buildProvider(final Local identity, final KeyFormat format) throws InteroperabilityException {
switch(format) {
case PKCS5:
return new PKCS5KeyFile.Factory().create();
case PKCS8:
return new PKCS8KeyFile.Factory().create();
case OpenSSH:
return new OpenSSHKeyFile.Factory().create();
case OpenSSHv1:
return new OpenSSHKeyV1KeyFile.Factory().create();
case PuTTY:
return new PuTTYKeyFile.Factory().create();
default:
throw new InteroperabilityException(String.format("Unknown key format for file %s", identity.getName()));
}
}
内容来源于网络,如有侵权,请联系作者删除!