@Test public void testMakeDirectory() throws Exception { final Path test = new Path(new FTPWorkdirService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)); new FTPDirectoryFeature(session).mkdir(test, null, new TransferStatus()); assertTrue(session.getFeature(Find.class).find(test)); new FTPDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); assertFalse(session.getFeature(Find.class).find(test)); }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { if(!session.getClient().makeDirectory(folder.getAbsolute())) { throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString()); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DefaultAttributesFinderFeature(session).find(folder)); }
FTPDirectoryFeature implements Directory<Integer> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { if(!session.getClient().makeDirectory(folder.getAbsolute())) { throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString()); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DefaultAttributesFinderFeature(session).find(folder)); } }
FTPDirectoryFeature implements Directory<Integer> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { if(!session.getClient().makeDirectory(folder.getAbsolute())) { throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString()); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DefaultAttributesFinderFeature(session).find(folder)); } FTPDirectoryFeature(final FTPSession session); }
FTPDirectoryFeature implements Directory<Integer> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { if(!session.getClient().makeDirectory(folder.getAbsolute())) { throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString()); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DefaultAttributesFinderFeature(session).find(folder)); } FTPDirectoryFeature(final FTPSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String name); @Override FTPDirectoryFeature withWriter(final Write writer); }
FTPDirectoryFeature implements Directory<Integer> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { if(!session.getClient().makeDirectory(folder.getAbsolute())) { throw new FTPException(session.getClient().getReplyCode(), session.getClient().getReplyString()); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Cannot create folder {0}", e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DefaultAttributesFinderFeature(session).find(folder)); } FTPDirectoryFeature(final FTPSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String name); @Override FTPDirectoryFeature withWriter(final Write writer);  }