@Test(expected = InteroperabilityException.class) public void testLockNotSupported() throws Exception { final TransferStatus status = new TransferStatus(); final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); final byte[] content = "test".getBytes(StandardCharsets.UTF_8); final OutputStream out = local.getOutputStream(false); IOUtils.write(content, out); out.close(); status.setLength(content.length); final Path test = new Path(new DefaultHomeFinderService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); final HttpUploadFeature upload = new DAVUploadFeature(new DAVWriteFeature(session)); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), status, new DisabledConnectionCallback()); new DAVLockFeature(session).lock(test); }
@Override public String lock(final Path file) throws BackgroundException { try { return session.getClient().lock(new DAVPathEncoder().encode(file)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Failure to write attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e, file); } }
DAVLockFeature implements Lock<String> { @Override public String lock(final Path file) throws BackgroundException { try { return session.getClient().lock(new DAVPathEncoder().encode(file)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Failure to write attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e, file); } } }
DAVLockFeature implements Lock<String> { @Override public String lock(final Path file) throws BackgroundException { try { return session.getClient().lock(new DAVPathEncoder().encode(file)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Failure to write attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e, file); } } DAVLockFeature(final DAVSession session); }
DAVLockFeature implements Lock<String> { @Override public String lock(final Path file) throws BackgroundException { try { return session.getClient().lock(new DAVPathEncoder().encode(file)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Failure to write attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e, file); } } DAVLockFeature(final DAVSession session); @Override String lock(final Path file); @Override void unlock(final Path file, final String token); }
DAVLockFeature implements Lock<String> { @Override public String lock(final Path file) throws BackgroundException { try { return session.getClient().lock(new DAVPathEncoder().encode(file)); } catch(SardineException e) { throw new DAVExceptionMappingService().map("Failure to write attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e, file); } } DAVLockFeature(final DAVSession session); @Override String lock(final Path file); @Override void unlock(final Path file, final String token);  }