@Test public void testLockNoSuchFile() throws Exception { FinderLocal l = new FinderLocal(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); assertNull(l.lock(false)); }
@Override public NSURL lock(final boolean interactive) throws AccessDeniedException { final NSURL resolved = resolver.resolve(this, interactive); if(null == resolved) { return null; } if(resolved.respondsToSelector(Foundation.selector("startAccessingSecurityScopedResource"))) { if(!resolved.startAccessingSecurityScopedResource()) { throw new LocalAccessDeniedException(String.format("Failure accessing security scoped resource for %s", this)); } } return resolved; }
FinderLocal extends Local { @Override public NSURL lock(final boolean interactive) throws AccessDeniedException { final NSURL resolved = resolver.resolve(this, interactive); if(null == resolved) { return null; } if(resolved.respondsToSelector(Foundation.selector("startAccessingSecurityScopedResource"))) { if(!resolved.startAccessingSecurityScopedResource()) { throw new LocalAccessDeniedException(String.format("Failure accessing security scoped resource for %s", this)); } } return resolved; } }
FinderLocal extends Local { @Override public NSURL lock(final boolean interactive) throws AccessDeniedException { final NSURL resolved = resolver.resolve(this, interactive); if(null == resolved) { return null; } if(resolved.respondsToSelector(Foundation.selector("startAccessingSecurityScopedResource"))) { if(!resolved.startAccessingSecurityScopedResource()) { throw new LocalAccessDeniedException(String.format("Failure accessing security scoped resource for %s", this)); } } return resolved; } FinderLocal(final Local parent, final String name);  FinderLocal(final Local parent, final String name, final FilesystemBookmarkResolver<NSURL> resolver);  FinderLocal(final String parent, final String name);  FinderLocal(final String parent, final String name, final FilesystemBookmarkResolver<NSURL> resolver);  FinderLocal(final String path);  FinderLocal(final String name, final FilesystemBookmarkResolver<NSURL> resolver); }
FinderLocal extends Local { @Override public NSURL lock(final boolean interactive) throws AccessDeniedException { final NSURL resolved = resolver.resolve(this, interactive); if(null == resolved) { return null; } if(resolved.respondsToSelector(Foundation.selector("startAccessingSecurityScopedResource"))) { if(!resolved.startAccessingSecurityScopedResource()) { throw new LocalAccessDeniedException(String.format("Failure accessing security scoped resource for %s", this)); } } return resolved; } FinderLocal(final Local parent, final String name);  FinderLocal(final Local parent, final String name, final FilesystemBookmarkResolver<NSURL> resolver);  FinderLocal(final String parent, final String name);  FinderLocal(final String parent, final String name, final FilesystemBookmarkResolver<NSURL> resolver);  FinderLocal(final String path);  FinderLocal(final String name, final FilesystemBookmarkResolver<NSURL> resolver); @Override T serialize(final Serializer dict); @Override String getDisplayName(); @Override String getAbbreviatedPath(); @Override Local getVolume(); @Override boolean exists(final LinkOption... options); @Override String getBookmark(); @Override void setBookmark(final String data); @Override AttributedList<Local> list(final Filter<String> filter); @Override OutputStream getOutputStream(boolean append); @Override NSURL lock(final boolean interactive); @Override void release(final Object lock); @Override InputStream getInputStream(); @Override FinderLocalAttributes attributes(); }
FinderLocal extends Local { @Override public NSURL lock(final boolean interactive) throws AccessDeniedException { final NSURL resolved = resolver.resolve(this, interactive); if(null == resolved) { return null; } if(resolved.respondsToSelector(Foundation.selector("startAccessingSecurityScopedResource"))) { if(!resolved.startAccessingSecurityScopedResource()) { throw new LocalAccessDeniedException(String.format("Failure accessing security scoped resource for %s", this)); } } return resolved; } FinderLocal(final Local parent, final String name);  FinderLocal(final Local parent, final String name, final FilesystemBookmarkResolver<NSURL> resolver);  FinderLocal(final String parent, final String name);  FinderLocal(final String parent, final String name, final FilesystemBookmarkResolver<NSURL> resolver);  FinderLocal(final String path);  FinderLocal(final String name, final FilesystemBookmarkResolver<NSURL> resolver); @Override T serialize(final Serializer dict); @Override String getDisplayName(); @Override String getAbbreviatedPath(); @Override Local getVolume(); @Override boolean exists(final LinkOption... options); @Override String getBookmark(); @Override void setBookmark(final String data); @Override AttributedList<Local> list(final Filter<String> filter); @Override OutputStream getOutputStream(boolean append); @Override NSURL lock(final boolean interactive); @Override void release(final Object lock); @Override InputStream getInputStream(); @Override FinderLocalAttributes attributes();  }