예제 #1
0
  /**
   * Creates a new unique file with the following pattern: <code>kouchat-current_time.extension
   * </code>.
   *
   * @param image The image to get the extension from.
   * @return A new unique file. Should not exist on the file system.
   */
  public static File createNewFile(final AndroidFile image) {
    final File externalStorageDirectory = Environment.getExternalStorageDirectory();
    final String fileName = "kouchat-" + System.currentTimeMillis() + image.getExtension();

    return new File(externalStorageDirectory, fileName);
  }