本文整理汇总了Java中com.jcraft.jsch.SftpATTRS.getFlags方法的典型用法代码示例。如果您正苦于以下问题:Java SftpATTRS.getFlags方法的具体用法?Java SftpATTRS.getFlags怎么用?Java SftpATTRS.getFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jcraft.jsch.SftpATTRS
的用法示例。
在下文中一共展示了SftpATTRS.getFlags方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileType
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
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
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
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
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
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
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
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
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
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: toMetaData
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
private ExternalResourceMetaData toMetaData(URI uri, SftpATTRS attributes) {
long lastModified = -1;
long contentLength = -1;
if ((attributes.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_ACMODTIME) != 0) {
lastModified = attributes.getMTime() * 1000;
}
if ((attributes.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_SIZE) != 0) {
contentLength = attributes.getSize();
}
return new DefaultExternalResourceMetaData(uri, lastModified, contentLength);
}
示例7: toMetaData
import com.jcraft.jsch.SftpATTRS; //导入方法依赖的package包/类
private ExternalResourceMetaData toMetaData(URI uri, SftpATTRS attributes) {
long lastModified = -1;
long contentLength = -1;
if ((attributes.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_ACMODTIME) != 0) {
lastModified = attributes.getMTime() * 1000;
}
if ((attributes.getFlags() & SftpATTRS.SSH_FILEXFER_ATTR_SIZE) != 0) {
contentLength = attributes.getSize();
}
return new DefaultExternalResourceMetaData(uri, lastModified, contentLength, null, null);
}