@Test public void testMakeDirectory() throws Exception { final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new IRODSProtocol()))); final Profile profile = new ProfilePlistReader(factory).read( new Local("../profiles/iRODS (iPlant Collaborative).cyberduckprofile")); final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials( System.getProperties().getProperty("irods.key"), System.getProperties().getProperty("irods.secret") )); final IRODSSession session = new IRODSSession(host); session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback()); session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback()); final Path test = new Path(new IRODSHomeFinderService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)); new IRODSDirectoryFeature(session).mkdir(test, null, new TransferStatus()); assertTrue(session.getFeature(Find.class).find(test)); session.getFeature(Delete.class).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); assertFalse(session.getFeature(Find.class).find(test)); session.close(); }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final IRODSFileSystemAO fs = session.getClient(); final IRODSFile f = fs.getIRODSFileFactory().instanceIRODSFile(folder.getAbsolute()); fs.mkdir(f, false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new IRODSAttributesFinderFeature(session).find(folder)); } catch(JargonException e) { throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder); } }
IRODSDirectoryFeature implements Directory<Void> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final IRODSFileSystemAO fs = session.getClient(); final IRODSFile f = fs.getIRODSFileFactory().instanceIRODSFile(folder.getAbsolute()); fs.mkdir(f, false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new IRODSAttributesFinderFeature(session).find(folder)); } catch(JargonException e) { throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder); } } }
IRODSDirectoryFeature implements Directory<Void> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final IRODSFileSystemAO fs = session.getClient(); final IRODSFile f = fs.getIRODSFileFactory().instanceIRODSFile(folder.getAbsolute()); fs.mkdir(f, false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new IRODSAttributesFinderFeature(session).find(folder)); } catch(JargonException e) { throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder); } } IRODSDirectoryFeature(final IRODSSession session); }
IRODSDirectoryFeature implements Directory<Void> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final IRODSFileSystemAO fs = session.getClient(); final IRODSFile f = fs.getIRODSFileFactory().instanceIRODSFile(folder.getAbsolute()); fs.mkdir(f, false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new IRODSAttributesFinderFeature(session).find(folder)); } catch(JargonException e) { throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder); } } IRODSDirectoryFeature(final IRODSSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override IRODSDirectoryFeature withWriter(final Write<Void> writer); }
IRODSDirectoryFeature implements Directory<Void> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { final IRODSFileSystemAO fs = session.getClient(); final IRODSFile f = fs.getIRODSFileFactory().instanceIRODSFile(folder.getAbsolute()); fs.mkdir(f, false); return new Path(folder.getParent(), folder.getName(), folder.getType(), new IRODSAttributesFinderFeature(session).find(folder)); } catch(JargonException e) { throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder); } } IRODSDirectoryFeature(final IRODSSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override IRODSDirectoryFeature withWriter(final Write<Void> writer);  }