Here you can find the source of getOutputStream(final File file)
public static FileOutputStream getOutputStream(final File file)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class Main { public static FileOutputStream getOutputStream(final File file) { try {//from w ww .ja v a 2 s . c om return new FileOutputStream(file); } catch (FileNotFoundException e) { return null; } } public static FileOutputStream getOutputStream(final String path) { return getOutputStream(getFile(path)); } public static File getFile(final String path) { return new File(path); } }