本文整理匯總了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;
}
}