@Override
  public FSDataOutputStream create(Path path, boolean overwrite, int bufferSize, short replication,
                                   long blockSize, Progressable progress) throws IOException {
    String confUmask = mAlluxioConf.getString(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK);
    Mode mode = ModeUtils.applyFileUMask(Mode.defaults(), confUmask);
    return this.create(path, new FsPermission(mode.toShort()), overwrite, bufferSize, replication,
        blockSize, progress);
  }
@Test
  public void createWithoutOverwrite() throws Exception {
    Path path = new Path("/file");
    alluxio.client.file.FileSystem alluxioFs =
        mock(alluxio.client.file.FileSystem.class);
    when(alluxioFs.exists(new AlluxioURI(HadoopUtils.getPathWithoutScheme(path))))
        .thenReturn(true);
    when(alluxioFs.createFile(eq(new AlluxioURI(HadoopUtils.getPathWithoutScheme(path))), any()))
        .thenThrow(new FileAlreadyExistsException(
            ExceptionMessage.CANNOT_OVERWRITE_FILE_WITHOUT_OVERWRITE.getMessage(path.toString())));

    try (FileSystem alluxioHadoopFs = new FileSystem(alluxioFs)) {
      alluxioHadoopFs.create(path,
          FsCreateModes.applyUMask(FsPermission.getFileDefault(), FsPermission.getUMask(getConf())),
          false, 100, (short) 1, 1000, null);
      fail("create() of existing file is expected to fail");
    } catch (IOException e) {
      assertEquals("alluxio.exception.FileAlreadyExistsException: "
              + ExceptionMessage.CANNOT_OVERWRITE_FILE_WITHOUT_OVERWRITE.getMessage(path),
          e.getMessage());
    }
  }