[jcifs] search files by jcifs
HMChung at ITRI.ORG.TW
HMChung at ITRI.ORG.TW
Wed Feb 26 20:30:18 EST 2003
Dear All:
I have a problem about jcifs libary.
I try to search files from multi-subdirectories by SmbFile.listFiles() or
SmbFile.listFiles(wildcard) method.
If there are many clients to search files from the file server,the reponse
time is too longer.
How to solove?
Here is my code.====================================================
long starttime = System.currentTimeMillis();
Find(getSmbFile,"*doc");
System.out.println(System.currentTimeMillis()-starttime);
System.out.println(c);
public void Find(SmbFile setSmbFiles,String keyword){
try{
SmbFile[] test2 = setSmbFiles.listFiles();
for(int j=0;j<test2.length;j++){
if(test2[j].isDirectory()==true){
Find(test2[j],keyword);
}
}
c = c + (setSmbFiles.listFiles(keyword)).length;
}catch(jcifs.smb.SmbException e){
}
}
More information about the jcifs
mailing list