Abdul,

Try this.


public long getSize(File source,long size){
try{
if (source.isDirectory()){
File [] filesInThisDir = source.listFiles();
for (int i=0;i<filesInThisDir.length;i++){
size=size+filesInThisDir[i].length();
getSize(filesInThisDir[i],size);
}
}
else{
size=size+source.length();
}
}
catch(Exception e){
e.printStackTrace();
}
return size;
}

Cheers,
Anjan Sharma (Vimon)


"Abdul" <rahuman_k@yahoo.com> wrote:
>
>
>How to find the Directory size including sub directories
>Is there and predefined methods...
>if not please send me the efficent java code to find the
>diorectory size(imp: it should include the subdirectory)