private static void checkTempDirs(String[] tmpDirs) throws IOException {
		for (String dir : tmpDirs) {
			if (dir != null && !dir.equals("")) {
				File file = new File(dir);
				if (!file.exists()) {
					if (!file.mkdirs()) {
						throw new IOException("Temporary file directory " + file.getAbsolutePath() + " does not exist and could not be created.");
					}
				}
				if (!file.isDirectory()) {
					throw new IOException("Temporary file directory " + file.getAbsolutePath() + " is not a directory.");
				}
				if (!file.canWrite()) {
					throw new IOException("Temporary file directory " + file.getAbsolutePath() + " is not writable.");
				}

				if (LOG.isInfoEnabled()) {
					long totalSpaceGb = file.getTotalSpace() >> 30;
					long usableSpaceGb = file.getUsableSpace() >> 30;
					double usablePercentage = (double) usableSpaceGb / totalSpaceGb * 100;
					String path = file.getAbsolutePath();
					LOG.info(String.format("Temporary file directory '%s': total %d GB, " + "usable %d GB (%.2f%% usable)",
						path, totalSpaceGb, usableSpaceGb, usablePercentage));
				}
			} else {
				throw new IllegalArgumentException("Temporary file directory #$id is null.");
			}
		}
	}
private static void checkTempDirs ( String [ ] tmpDirs ) throws IOException { for ( String dir : tmpDirs ) { if ( dir != null && ! dir . equals ( "" ) ) { File file = new File ( dir ) ; if ( ! file . exists ( ) ) { if ( ! file . mkdirs ( ) ) { throw new IOException ( "Temporary file directory " + file . getAbsolutePath ( ) + " does not exist and could not be created." ) ; } } if ( ! file . isDirectory ( ) ) { throw new IOException ( "Temporary file directory " + file . getAbsolutePath ( ) + " is not a directory." ) ; } if ( ! file . canWrite ( ) ) { throw new IOException ( "Temporary file directory " + file . getAbsolutePath ( ) + " is not writable." ) ; } if ( LOG . isInfoEnabled ( ) ) { long totalSpaceGb = file . getTotalSpace ( ) > > 30 ; long usableSpaceGb = file . getUsableSpace ( ) > > 30 ; double usablePercentage = ( double ) usableSpaceGb / totalSpaceGb * 100 ; String path = file . getAbsolutePath ( ) ; LOG . info ( String . format ( "Temporary file directory '%s': total %d GB, " + "usable %d GB (%.2f%% usable)" , path , totalSpaceGb , usableSpaceGb , usablePercentage ) ) ; } } else { throw new IllegalArgumentException ( "Temporary file directory #$id is null." ) ; } } }
Validates that all the directories denoted by the strings do actually exist or can be created, are proper
directories (not files), and are writable.

@param tmpDirs The array of directory paths to check.
@throws IOException Thrown if any of the directories does not exist and cannot be created or is not writable
or is a file, rather than a directory.