本文整理汇总了Java中com.jcraft.jsch.SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS属性的典型用法代码示例。如果您正苦于以下问题:Java SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS属性的具体用法?Java SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS怎么用?Java SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.jcraft.jsch.SftpATTRS
的用法示例。
在下文中一共展示了SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileType
public FileType getFileType(String filename) throws KettleJobException
{
try {
SftpATTRS attrs=c.stat(filename);
if (attrs == null) return FileType.IMAGINARY;
if ((attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS) == 0)
throw new KettleJobException("Unknown permissions error");
if (attrs.isDir())
return FileType.FOLDER;
else
return FileType.FILE;
} catch (Exception e) {
throw new KettleJobException(e);
}
}
示例2: folderExists
public boolean folderExists(String foldername)
{
boolean retval =false;
try {
SftpATTRS attrs=c.stat(foldername);
if (attrs == null) return false;
if ((attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS) == 0)
throw new KettleJobException("Unknown permissions error");
retval=attrs.isDir();
} catch (Exception e) {
// Folder can not be found!
}
return retval;
}
示例3: folderExists
public boolean folderExists(String foldername)
{
boolean retval =false;
try {
SftpATTRS attrs=c.stat(foldername);
if (attrs == null) return false;
if ((attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS) == 0)
throw new KettleJobException("Unknown permissions error");
retval=attrs.isDir();
} catch (Exception e) {
// Folder can not be found!
}
return retval;
}
示例4: getFileType
public FileType getFileType( String filename ) throws KettleJobException {
try {
SftpATTRS attrs = c.stat( filename );
if ( attrs == null ) {
return FileType.IMAGINARY;
}
if ( ( attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS ) == 0 ) {
throw new KettleJobException( "Unknown permissions error" );
}
if ( attrs.isDir() ) {
return FileType.FOLDER;
} else {
return FileType.FILE;
}
} catch ( Exception e ) {
throw new KettleJobException( e );
}
}
示例5: folderExists
public boolean folderExists( String foldername ) {
boolean retval = false;
try {
SftpATTRS attrs = c.stat( foldername );
if ( attrs == null ) {
return false;
}
if ( ( attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS ) == 0 ) {
throw new KettleJobException( "Unknown permissions error" );
}
retval = attrs.isDir();
} catch ( Exception e ) {
// Folder can not be found!
}
return retval;
}
示例6: doGetType
/**
* Determines the type of this file, returns null if the file does not
* exist.
*/
@Override
protected FileType doGetType() throws Exception
{
if (attrs == null)
{
statSelf();
}
if (attrs == null)
{
return FileType.IMAGINARY;
}
if ((attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS) == 0)
{
throw new FileSystemException(
"vfs.provider.sftp/unknown-permissions.error");
}
if (attrs.isDir())
{
return FileType.FOLDER;
}
else
{
return FileType.FILE;
}
}
示例7: doGetType
/**
* Determines the type of this file, returns null if the file does not
* exist.
*/
protected FileType doGetType() throws Exception
{
if (attrs == null)
{
statSelf();
}
if (attrs == null)
{
return FileType.IMAGINARY;
}
if ((attrs.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS) == 0)
{
throw new FileSystemException(
"vfs.provider.sftp/unknown-permissions.error");
}
if (attrs.isDir())
{
return FileType.FOLDER;
}
else
{
return FileType.FILE;
}
}