public static File generateContentPath(Context context,String type){
  if (context == null) {
    return null;
  }
  File base=context.getExternalFilesDir(type);
  if (base == null) {
    return null;
  }
  if (!base.exists()) {
    if (!base.mkdirs()) {
      return null;
    }
  }
  return base;
}

public static File generateContentPath ( Context context , String type ) { if ( context == null ) { return null ; } File base = context . getExternalFilesDir ( type ) ; if ( base == null ) { return null ; } if ( ! base . exists ( ) ) { if ( ! base . mkdirs ( ) ) { return null ; } } return base ; }
find a path to store the specific type of content , ensuring that it exists . returns null if none can be found or created .
