question: public static OutputStream outputStream ( String out ) throws IOException { if ( out . equals ( "-" ) ) { return ForbiddenOk . systemDotOut ( ) ; } Files . createParentDirs ( new File ( out ) ) ; OutputStream stream = new BufferedOutputStream ( new FileOutputStream ( out ) ) ; if ( out . endsWith ( ".gz" ) ) { stream = new GZIPOutputStream ( stream ) ; } return stream ; }
target:  Get an output stream for a file. If the file is - then returns stdin instead. If the file looks like a gzip file then zips it on the fly. Also creates the file file's parent directories if they don't already exist.