@Test public void testMakeDirectory() throws Exception { final Path test = new Path(new DefaultHomeFinderService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)); new DAVDirectoryFeature(session).mkdir(test, null, new TransferStatus()); assertTrue(session.getFeature(Find.class).find(test)); new DAVDeleteFeature(session).delete(Collections.<Path>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 { session.getClient().createDirectory(new DAVPathEncoder().encode(folder)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new HttpExceptionMappingService().map(e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DAVAttributesFinderFeature(session).find(folder)); }
DAVDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().createDirectory(new DAVPathEncoder().encode(folder)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new HttpExceptionMappingService().map(e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DAVAttributesFinderFeature(session).find(folder)); } }
DAVDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().createDirectory(new DAVPathEncoder().encode(folder)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new HttpExceptionMappingService().map(e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DAVAttributesFinderFeature(session).find(folder)); } DAVDirectoryFeature(final DAVSession session); }
DAVDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().createDirectory(new DAVPathEncoder().encode(folder)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new HttpExceptionMappingService().map(e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DAVAttributesFinderFeature(session).find(folder)); } DAVDirectoryFeature(final DAVSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override DAVDirectoryFeature withWriter(final Write<String> writer); }
DAVDirectoryFeature implements Directory<String> { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try { session.getClient().createDirectory(new DAVPathEncoder().encode(folder)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Cannot create folder {0}", e, folder); } catch(IOException e) { throw new HttpExceptionMappingService().map(e, folder); } return new Path(folder.getParent(), folder.getName(), folder.getType(), new DAVAttributesFinderFeature(session).find(folder)); } DAVDirectoryFeature(final DAVSession session); @Override Path mkdir(final Path folder, final String region, final TransferStatus status); @Override DAVDirectoryFeature withWriter(final Write<String> writer);  }