@Test public void testWhitespaceMkdir() throws Exception { final RandomStringService randomStringService = new AlphanumericRandomStringService(); final Path target = new MantaDirectoryFeature(session) .mkdir( new Path( testPathPrefix, String.format("%s %s", randomStringService.random(), randomStringService.random()), EnumSet.of(Path.Type.directory) ), null, null); final Attributes found = new MantaAttributesFinderFeature(session).find(target); assertNull(found.getOwner()); 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);  }