本文整理匯總了Java中jcifs.smb.SmbFile.TYPE_NAMED_PIPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java SmbFile.TYPE_NAMED_PIPE屬性的具體用法?Java SmbFile.TYPE_NAMED_PIPE怎麽用?Java SmbFile.TYPE_NAMED_PIPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類jcifs.smb.SmbFile
的用法示例。
在下文中一共展示了SmbFile.TYPE_NAMED_PIPE屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
public static void main( String[] argv ) throws Exception {
SmbFile file = new SmbFile( argv[0] );
long t1 = System.currentTimeMillis();
SmbFile[] files = file.listFiles();
long t2 = System.currentTimeMillis() - t1;
for( int i = 0; i < files.length; i++ ) {
System.out.print( " " + files[i].getName() );
switch(files[i].getType()) {
case SmbFile.TYPE_FILESYSTEM:
System.out.println( "[TYPE_FILESYSTEM]" );
break;
case SmbFile.TYPE_WORKGROUP:
System.out.println( "[TYPE_WORKGROUP]" );
break;
case SmbFile.TYPE_SERVER:
System.out.println( "[TYPE_SERVER]" );
break;
case SmbFile.TYPE_SHARE:
System.out.println( "[TYPE_SHARE]" );
break;
case SmbFile.TYPE_NAMED_PIPE:
System.out.println( "[TYPE_NAMEDPIPE]" );
break;
case SmbFile.TYPE_PRINTER:
System.out.println( "[TYPE_PRINTER]" );
break;
case SmbFile.TYPE_COMM:
System.out.println( "[TYPE_COMM]" );
break;
};
}
System.out.println( files.length + " files in " + t2 + "ms" );
}
示例2: main
public static void main( String[] argv ) throws Exception {
SmbFile file = new SmbFile( argv[0] );
int type;
switch( file.getType() ) {
case SmbFile.TYPE_FILESYSTEM:
type = 0;
break;
case SmbFile.TYPE_WORKGROUP:
type = 1;
break;
case SmbFile.TYPE_SERVER:
type = 2;
break;
case SmbFile.TYPE_SHARE:
type = 3;
break;
case SmbFile.TYPE_NAMED_PIPE:
type = 4;
break;
case SmbFile.TYPE_PRINTER:
type = 5;
break;
case SmbFile.TYPE_COMM:
type = 6;
break;
default:
throw new RuntimeException( "Unknown service type: " + file.getType() );
}
System.out.println( types[type] );
System.out.println();
long t1 = System.currentTimeMillis();
String[] files = file.list();
long t2 = System.currentTimeMillis() - t1;
for( int i = 0; i < files.length; i++ ) {
System.out.print( " " + files[i] );
}
System.out.println();
System.out.println( files.length + " files in " + t2 + "ms" );
}