static boolean isOutputFileAccessable(String file) {
        if (file == null) {
            return false;
        }

        File outputFile = new File(file).getAbsoluteFile();

        if (outputFile.exists()) {
            return outputFile.canWrite() && outputFile.isFile();
        } else {
            return outputFile.getParentFile().canWrite();
        }
    }