private void checkFileValidity ( File image ) throws TwitterException { if ( ! image . exists ( ) ) { //noinspection ThrowableInstanceNeverThrown throw new TwitterException ( new FileNotFoundException ( image + " is not found." ) ) ; } if ( ! image . isFile ( ) ) { //noinspection ThrowableInstanceNeverThrown throw new TwitterException ( new IOException ( image + " is not a file." ) ) ; } }
Check the existence and the type of the specified file .