code: public OutputStream newOutputStream(org.apache.hadoop.fs.Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
          throws IOException
    {
      checkWritable();
          boolean hasCreateNew = false;
          boolean hasCreate = false;
          boolean hasAppend = false;
          for (OpenOption opt: options) {
              if (opt == READ)
                  throw new IllegalArgumentException("READ not allowed");
              if (opt == CREATE_NEW)
                  hasCreateNew = true;
              if (opt == CREATE)
                  hasCreate = true;
              if (opt == APPEND)
                  hasAppend = true;
          }
          //beginRead();                 // only need a readlock, the "update()" will
          /*try {                        // try to obtain a writelock when the os is
              ensureOpen();            // being closed.
              //Entry e = getEntry0(path);
              HadoopFileAttributes e = path.getAttributes();
              if (e != null) {
                  if (e.isDirectory() || hasCreateNew)
                      throw new FileAlreadyExistsException(path.toString());
                  if (hasAppend) {
                      InputStream is = getInputStream(e);
                      OutputStream os = getOutputStream(new Entry(e, Entry.NEW));
                      copyStream(is, os);
                      is.close();
                      return os;
                  }
                  return getOutputStream(new Entry(e, Entry.NEW));
              } else {
                  if (!hasCreate && !hasCreateNew)
                      throw new NoSuchFileException(path.toString());
                  checkParents(path);
                  return getOutputStream(new Entry(path, Entry.NEW));
              }
          } finally {
              //endRead();
          }*/
          
          FSDataOutputStream outputStream = this.fs.create(path);
          /*
          for (int i = 0; i < attrs.length; i++) {
          	FileAttribute<?> item = attrs[i];
  			if (item.value().getClass() == PosixFilePermissions.class) {
          		Set<PosixFilePermission> itemPs = (Set<PosixFilePermission>) item.value();
  				FsPermission p = FsPermission.valueOf("-" + PosixFilePermissions.toString(itemPs));
          		this.fs.setPermission(path, p);
          		break;
          	}
          	System.out.println(item.getClass());
          }
          */
          return outputStream;
      }
docs: entry.