question: private static boolean isWritable ( @ NonNull final File file ) { boolean isExisting = file . exists ( ) ; try { FileOutputStream output = new FileOutputStream ( file , true ) ; try { output . close ( ) ; } catch ( IOException e ) { } } catch ( java . io . FileNotFoundException e ) { return false ; } boolean result = file . canWrite ( ) ; if ( ! isExisting ) { file . delete ( ) ; } return result ; }
target:  Check is a file is writable. Detects write issues on external SD card.