@Test public void testMkdir() throws Exception { final Path target = new MantaDirectoryFeature(session).mkdir(randomDirectory(), null, null); final PathAttributes found = new MantaAttributesFinderFeature(session).find(target); assertNotEquals(Permission.EMPTY, found.getPermission()); new MantaDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().putDirectory(folder.getAbsolute()); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new MantaAttributesFinderFeature(session).find(folder)); }
MantaDirectoryFeature implements Directory { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().putDirectory(folder.getAbsolute()); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new MantaAttributesFinderFeature(session).find(folder)); } }
MantaDirectoryFeature implements Directory { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().putDirectory(folder.getAbsolute()); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new MantaAttributesFinderFeature(session).find(folder)); } MantaDirectoryFeature(MantaSession session); }
MantaDirectoryFeature implements Directory { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().putDirectory(folder.getAbsolute()); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new MantaAttributesFinderFeature(session).find(folder)); } MantaDirectoryFeature(MantaSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String name); @Override Directory withWriter(final Write writer); }
MantaDirectoryFeature implements Directory { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().putDirectory(folder.getAbsolute()); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new MantaAttributesFinderFeature(session).find(folder)); } MantaDirectoryFeature(MantaSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String name); @Override Directory withWriter(final Write writer);  }