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