@Override
  public DataOutputStream create(final String name) throws IOException {
    final String directoryPath = outputPath + File.separator + name;
    final File directory = new File(directoryPath);

    synchronized (TaskOutputStreamProviderLocal.class) {
      if (!directory.exists() && !directory.mkdirs()) {
        LOG.log(Level.WARNING, "Failed to create [{0}]", directory.getAbsolutePath());
      }
    }

    final File file = new File(directoryPath + File.separator + getTaskId());
    return new DataOutputStream(new FileOutputStream(file));
  }
@ Override public DataOutputStream create ( final String name ) throws IOException { final String directoryPath = outputPath + File . separator + name ; final File directory = new File ( directoryPath ) ; synchronized ( TaskOutputStreamProviderLocal . class ) { if ( ! directory . exists ( ) && ! directory . mkdirs ( ) ) { LOG . log ( Level . WARNING , "Failed to create [{0}]" , directory . getAbsolutePath ( ) ) ; } } final File file = new File ( directoryPath + File . separator + getTaskId ( ) ) ; return new DataOutputStream ( new FileOutputStream ( file ) ) ; }
create a file output stream using the given name.
The path of the file on the local file system is 'outputPath/name/taskId'.

@param name name of the created output stream
It is used as the name of the directory if the created output stream is a file output stream
@return OutputStream to a file on local file system. The path of the file is 'outputPath/name/taskId'
@throws java.io.IOException