本文整理了Java中com.jcraft.jsch.ChannelSftp.chown()
方法的一些代码示例,展示了ChannelSftp.chown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ChannelSftp.chown()
方法的具体详情如下:
包路径:com.jcraft.jsch.ChannelSftp
类名称:ChannelSftp
方法名:chown
[英]Changes the owning user of one or several remote files.
[中]更改一个或多个远程文件的所有者用户。
代码示例来源:origin: apache/nifi
if (owner != null && !owner.trim().isEmpty()) {
try {
sftp.chown(Integer.parseInt(owner), tempPath);
} catch (final Exception e) {
logger.error("Failed to set owner on {} to {} due to {}", new Object[] {tempPath, owner, e});
代码示例来源:origin: com.github.robtimus/sftp-fs
void chown(String path, int uid) throws IOException {
try {
channel.chown(uid, path);
} catch (SftpException e) {
throw exceptionFactory.createSetOwnerException(path, e);
}
}
代码示例来源:origin: fizzed/blaze
@Override
public void chown(Path path, int uid) {
try {
this.channel.chown(uid, PathHelper.toString(path));
} catch (SftpException e) {
throw convertSftpException(e);
}
}
代码示例来源:origin: org.kuali.common/kuali-util
protected void setAttributes(RemoteFile file) throws SftpException {
String path = file.getAbsolutePath();
if (file.getPermissions().isPresent()) {
sftp.chmod(file.getPermissions().get(), path);
}
if (file.getGroupId().isPresent()) {
sftp.chgrp(file.getGroupId().get(), path);
}
if (file.getUserId().isPresent()) {
sftp.chown(file.getUserId().get(), path);
}
}
代码示例来源:origin: org.kuali.common/kuali-util
protected void setAttributes(RemoteFile file) throws SftpException {
String path = file.getAbsolutePath();
if (file.getPermissions().isPresent()) {
sftp.chmod(file.getPermissions().get(), path);
}
if (file.getGroupId().isPresent()) {
sftp.chgrp(file.getGroupId().get(), path);
}
if (file.getUserId().isPresent()) {
sftp.chown(file.getUserId().get(), path);
}
}
代码示例来源:origin: org.apache.nifi/nifi-standard-processors
if (owner != null && !owner.trim().isEmpty()) {
try {
sftp.chown(Integer.parseInt(owner), tempPath);
} catch (final Exception e) {
logger.error("Failed to set owner on {} to {} due to {}", new Object[] {tempPath, owner, e});
代码示例来源:origin: org.kuali.common/kuali-util
protected void setAttributes(RemoteFile file) throws SftpException {
String path = file.getAbsolutePath();
if (file.getPermissions() != null) {
sftp.chmod(file.getPermissions(), path);
}
if (file.getGroupId() != null) {
sftp.chgrp(file.getGroupId(), path);
}
if (file.getUserId() != null) {
sftp.chown(file.getUserId(), path);
}
}
内容来源于网络,如有侵权,请联系作者删除!