当前位置: 首页>>代码示例>>Java>>正文


Java SFTPv3FileAttributes类代码示例

本文整理汇总了Java中com.trilead.ssh2.SFTPv3FileAttributes的典型用法代码示例。如果您正苦于以下问题:Java SFTPv3FileAttributes类的具体用法?Java SFTPv3FileAttributes怎么用?Java SFTPv3FileAttributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SFTPv3FileAttributes类属于com.trilead.ssh2包,在下文中一共展示了SFTPv3FileAttributes类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mkdirs

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
 * Makes sure that the directory exists, by creating it if necessary.
 */
public void mkdirs(String path, int posixPermission) throws IOException {
    SFTPv3FileAttributes atts = _stat(path);
    if (atts!=null && atts.isDirectory())
        return;

    int idx = path.lastIndexOf('/');
    if (idx>0)
        mkdirs(path.substring(0,idx), posixPermission);

    try {
        mkdir(path, posixPermission);
    } catch (IOException e) {
        throw new IOException2("Failed to mkdir "+path,e);
    }
}
 
开发者ID:thescouser89,项目名称:ovirt-slaves-plugin,代码行数:19,代码来源:SFTPClient.java

示例2: sshFileExists

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
 * Check existence of a file
 * 
 * @param sftpClient
 * @param filename
 * @return true, if file exists
 * @throws Exception
 */
public boolean sshFileExists(SFTPv3Client sftpClient, String filename) {
    
    try {
        SFTPv3FileAttributes attributes = sftpClient.stat(filename);
        
        if (attributes != null) {
            return (attributes.isRegularFile());
        } else {
            return false;
        }
        
    } catch (Exception e) {
        return false;
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:24,代码来源:JobEntrySSH2GET.java

示例3: sshFileExists

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
* Check existence of a file
* 
* @param sftpClient
* @param filename
* @return true, if file exists
* @throws Exception
*/
  public boolean sshFileExists(SFTPv3Client sftpClient, String filename) {
      
      try {
          SFTPv3FileAttributes attributes = sftpClient.stat(filename);
          
          if (attributes != null) {
              return (attributes.isRegularFile());
          } else {
              return false;
          }
          
      } catch (Exception e) {
          return false;
      }
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:24,代码来源:JobEntrySSH2PUT.java

示例4: sshDirectoryExists

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
 * Checks if a directory exists
 * 
 * @param sftpClient
 * @param directory
 * @return true, if directory exists
 */
public boolean sshDirectoryExists(SFTPv3Client sftpClient, String directory)  {
try {
       SFTPv3FileAttributes attributes = sftpClient.stat(directory);
          
        if (attributes != null) {
             return (attributes.isDirectory());
          } else {
              return false;
          }
          
    } catch (Exception e) {
          return false;
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:JobEntrySSH2GETDialog.java

示例5: sshFileExists

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
 * Check existence of a file
 *
 * @param sftpClient
 * @param filename
 * @return true, if file exists
 * @throws Exception
 */
public boolean sshFileExists( SFTPv3Client sftpClient, String filename ) {

  try {
    SFTPv3FileAttributes attributes = sftpClient.stat( filename );

    if ( attributes != null ) {
      return ( attributes.isRegularFile() );
    } else {
      return false;
    }

  } catch ( Exception e ) {
    return false;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:JobEntrySSH2GET.java

示例6: _stat

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
 * Graceful {@link #stat(String)} that returns null if the path doesn't exist.
 */
public SFTPv3FileAttributes _stat(String path) throws IOException {
    try {
        return stat(path);
    } catch (SFTPException e) {
        int c = e.getServerErrorCode();
        if (c==ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH)
            return null;
        else
            throw e;
    }
}
 
开发者ID:thescouser89,项目名称:ovirt-slaves-plugin,代码行数:15,代码来源:SFTPClient.java

示例7: sshDirectoryExists

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
/**
 * Checks if a directory exists
 *
 * @param sftpClient
 * @param directory
 * @return true, if directory exists
 */
public boolean sshDirectoryExists( SFTPv3Client sftpClient, String directory ) {
  try {
    SFTPv3FileAttributes attributes = sftpClient.stat( directory );

    if ( attributes != null ) {
      return ( attributes.isDirectory() );
    } else {
      return false;
    }

  } catch ( Exception e ) {
    return false;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:JobEntryFTPDeleteDialog.java

示例8: chmod

import com.trilead.ssh2.SFTPv3FileAttributes; //导入依赖的package包/类
public void chmod(String path, int permissions) throws IOException {
    SFTPv3FileAttributes atts = new SFTPv3FileAttributes();
    atts.permissions = permissions;
    setstat(path, atts);
}
 
开发者ID:thescouser89,项目名称:ovirt-slaves-plugin,代码行数:6,代码来源:SFTPClient.java


注:本文中的com.trilead.ssh2.SFTPv3FileAttributes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。