@Override public FSDataOutputStream create(final Path filePath, final WriteMode overwrite) throws IOException { checkNotNull(filePath, "filePath"); if (exists(filePath) && overwrite == WriteMode.NO_OVERWRITE) { throw new FileAlreadyExistsException("File already exists: " + filePath); } final Path parent = filePath.getParent(); if (parent != null && !mkdirs(parent)) { throw new IOException("Mkdirs failed to create " + parent); } final File file = pathToFile(filePath); return new LocalDataOutputStream(file); }
@Override public FSDataOutputStream create(final Path filePath, final WriteMode overwrite) throws IOException { checkNotNull(filePath, "filePath"); if (exists(filePath) && overwrite == WriteMode.NO_OVERWRITE) { throw new FileAlreadyExistsException("File already exists: " + filePath); } final Path parent = filePath.getParent(); if (parent != null && !mkdirs(parent)) { throw new IOException("Mkdirs failed to create " + parent); } final File file = pathToFile(filePath); return new LocalDataOutputStream(file); }
@Override public FSDataOutputStream create(final Path filePath, final WriteMode overwrite) throws IOException { checkNotNull(filePath, "filePath"); if (exists(filePath) && overwrite == WriteMode.NO_OVERWRITE) { throw new FileAlreadyExistsException("File already exists: " + filePath); } final Path parent = filePath.getParent(); if (parent != null && !mkdirs(parent)) { throw new IOException("Mkdirs failed to create " + parent); } final File file = pathToFile(filePath); return new LocalDataOutputStream(file); }