Here you can find the source of getOutputStream(String path)
public static OutputStream getOutputStream(String path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static OutputStream getOutputStream(String path) throws IOException { return new FileOutputStream(touch(path)); }/*w ww . j av a 2s . c om*/ public static File touch(String fullFilePath) throws IOException { if (fullFilePath == null) { return null; } File file = new File(fullFilePath); file.getParentFile().mkdirs(); if (!file.exists()) file.createNewFile(); return file; } }