private boolean checkDeploymentDir ( File directory ) { if ( ! directory . exists ( ) ) { if ( deploymentDirAccessible ) { deploymentDirAccessible = false ; ROOT_LOGGER . directoryIsNonexistent ( deploymentDir . getAbsolutePath ( ) ) ; } } else if ( ! directory . isDirectory ( ) ) { if ( deploymentDirAccessible ) { deploymentDirAccessible = false ; ROOT_LOGGER . isNotADirectory ( deploymentDir . getAbsolutePath ( ) ) ; } } else if ( ! directory . canRead ( ) ) { if ( deploymentDirAccessible ) { deploymentDirAccessible = false ; ROOT_LOGGER . directoryIsNotReadable ( deploymentDir . getAbsolutePath ( ) ) ; } } else if ( ! directory . canWrite ( ) ) { if ( deploymentDirAccessible ) { deploymentDirAccessible = false ; ROOT_LOGGER . directoryIsNotWritable ( deploymentDir . getAbsolutePath ( ) ) ; } } else { deploymentDirAccessible = true ; } return deploymentDirAccessible ; }
Checks that given directory if readable & writable and prints a warning if the check fails . Warning is only printed once and is not repeated until the condition is fixed and broken again .