Posts

Showing posts from September 23, 2010

Directory Size in java code example

How to get Directory Size in java code example? public static long getDirectorySize(String directoryPath)     {         dirSize = 0L;         dirSize = calDirectorySize(directoryPath);         return dirSize;     }  private static long calDirectorySize(String directoryPath)     {         File fd = new File(directoryPath);         if(!fd.isFile())         {             String list[] = fd.list();             for(int i = 0; i < list.length; i++)             {                 Stri...

String Array to String separator java

How to convert String Array to String with separator java code, Examples public static String arrayToString(String[] a, String separator) {     String result = "";     if (a.length > 0) {         result = a[0];    // start with the first element         for (int i=1; i             result = result + separator + a[i];         }     }     return result; }

Recent Post

Recent Posts Widget