@Test public void testSetWhereFrom() throws Exception { final QuarantineService q = new LaunchServicesQuarantineService(); Callable<Local> c = new Callable<Local>() { @Override public Local call() throws Exception { final NullLocal l = new NullLocal(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); LocalTouchFactory.get().touch(l); q.setWhereFrom(l, "http: l.delete(); return l; } }; c.call(); }
@Override public void setWhereFrom(final Local file, final String dataUrl) throws LocalAccessDeniedException { synchronized(lock) { if(StringUtils.isBlank(dataUrl)) { log.warn("No data url given"); return; } if(!this.setWhereFrom(file.getAbsolute(), dataUrl)) { throw new LocalAccessDeniedException(file.getAbsolute()); } } }
LaunchServicesQuarantineService implements QuarantineService { @Override public void setWhereFrom(final Local file, final String dataUrl) throws LocalAccessDeniedException { synchronized(lock) { if(StringUtils.isBlank(dataUrl)) { log.warn("No data url given"); return; } if(!this.setWhereFrom(file.getAbsolute(), dataUrl)) { throw new LocalAccessDeniedException(file.getAbsolute()); } } } }
LaunchServicesQuarantineService implements QuarantineService { @Override public void setWhereFrom(final Local file, final String dataUrl) throws LocalAccessDeniedException { synchronized(lock) { if(StringUtils.isBlank(dataUrl)) { log.warn("No data url given"); return; } if(!this.setWhereFrom(file.getAbsolute(), dataUrl)) { throw new LocalAccessDeniedException(file.getAbsolute()); } } }  }
LaunchServicesQuarantineService implements QuarantineService { @Override public void setWhereFrom(final Local file, final String dataUrl) throws LocalAccessDeniedException { synchronized(lock) { if(StringUtils.isBlank(dataUrl)) { log.warn("No data url given"); return; } if(!this.setWhereFrom(file.getAbsolute(), dataUrl)) { throw new LocalAccessDeniedException(file.getAbsolute()); } } }  @Override void setQuarantine(final Local file, final String originUrl, final String dataUrl); @Override void setWhereFrom(final Local file, final String dataUrl); }
LaunchServicesQuarantineService implements QuarantineService { @Override public void setWhereFrom(final Local file, final String dataUrl) throws LocalAccessDeniedException { synchronized(lock) { if(StringUtils.isBlank(dataUrl)) { log.warn("No data url given"); return; } if(!this.setWhereFrom(file.getAbsolute(), dataUrl)) { throw new LocalAccessDeniedException(file.getAbsolute()); } } }  @Override void setQuarantine(final Local file, final String originUrl, final String dataUrl); @Override void setWhereFrom(final Local file, final String dataUrl);  }