本文整理匯總了Java中com.jcraft.jsch.SftpATTRS.getUId方法的典型用法代碼示例。如果您正苦於以下問題:Java SftpATTRS.getUId方法的具體用法?Java SftpATTRS.getUId怎麽用?Java SftpATTRS.getUId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jcraft.jsch.SftpATTRS
的用法示例。
在下文中一共展示了SftpATTRS.getUId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createStatInfo
import com.jcraft.jsch.SftpATTRS; //導入方法依賴的package包/類
private StatInfo createStatInfo(String dirName, String baseName, SftpATTRS attrs, ChannelSftp cftp) throws SftpException {
String linkTarget = null;
if (attrs.isLink()) {
String path = dirName + '/' + baseName;
RemoteStatistics.ActivityID activityID = RemoteStatistics.startChannelActivity("readlink", path); // NOI18N
try {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "performing readlink {0}", path);
}
linkTarget = cftp.readlink(path);
} finally {
RemoteStatistics.stopChannelActivity(activityID);
}
}
Date lastModified = new Date(attrs.getMTime() * 1000L);
StatInfo result = new FileInfoProvider.StatInfo(baseName, attrs.getUId(), attrs.getGId(), attrs.getSize(),
attrs.isDir(), attrs.isLink(), linkTarget, attrs.getPermissions(), lastModified);
return result;
}
示例2: getOwnerID
import com.jcraft.jsch.SftpATTRS; //導入方法依賴的package包/類
public int getOwnerID(String path) throws VrsException
{
// SftpATTRS attrs=new SftpATTRS();
SftpATTRS attrs = getSftpAttrs(path);
return attrs.getUId();
}
示例3: getAttribute
import com.jcraft.jsch.SftpATTRS; //導入方法依賴的package包/類
public Attribute getAttribute(VFSNode node, SftpATTRS attrs, String name, boolean isDir, boolean update)
throws VrsException
{
// Optimization: only update if a SftpAttribute AND an update is
// requested:
if (name == null)
return null;
// initialize attributes if not yet fetched!
if (attrs == null)
{
attrs = this.getSftpAttrs(node.getPath());
}
// get attributes from same holder:
if (name.compareTo(ATTR_MODIFICATION_TIME) == 0)
{
return AttributeUtil.createDateFromMilliesSinceEpoch(name, getModificationTime(attrs));
}
else if (name.compareTo(ATTR_LASTACCESS_TIME) == 0)
{
return new Attribute(AttributeType.DATETIME, name, getAccessTime(attrs));
}
else if (name.compareTo(ATTR_FILE_SIZE) == 0)
{
return new Attribute(name, attrs.getSize());
}
else if (name.compareTo(ATTR_UNIX_USERID) == 0)
{
return new Attribute(name, attrs.getUId());
}
else if (name.compareTo(ATTR_UNIX_GROUPID) == 0)
{
return new Attribute(name, attrs.getGId());
}
else if (name.compareTo(ATTR_UNIX_FILE_MODE) == 0)
{
// note sftp attributes return higher value the (8)07777 (isdir and
// islink)
return new Attribute(name, "0" + Integer.toOctalString(attrs.getPermissions() % 07777));
}
return null;
}