public final class MacFileNSURL
extends java.io.File
File
class that also provides access to the
underlying native NSURL object associated with this File instance.
Objects of this type are returned as a result of invoking the
CommonDialogs.show[File|Folder]Chooser()
methods if
the "glass.macosx.enableFileNSURL" system property is true
.Modifier and Type | Field and Description |
---|---|
private long |
ptr
A pointer to the NSURL object.
|
Modifier | Constructor and Description |
---|---|
private |
MacFileNSURL(java.lang.String name,
long ptr) |
Modifier and Type | Method and Description |
---|---|
private static MacFileNSURL |
_createFromBookmark(byte[] data,
long baseDocumentPtr) |
private void |
_dispose(long ptr) |
private byte[] |
_getBookmark(long ptr,
long baseDocumentPtr) |
private static void |
_initIDs() |
private boolean |
_startAccessingSecurityScopedResource(long ptr) |
private void |
_stopAccessingSecurityScopedResource(long ptr) |
private void |
checkNotDisposed() |
static MacFileNSURL |
createFromBookmark(byte[] data)
Returns an instance of the MacFileNSURL class created from bookmark
data stored in the byte array passed as an argument.
|
static MacFileNSURL |
createFromDocumentScopedBookmark(byte[] data,
MacFileNSURL baseDocument)
Returns an instance of the MacFileNSURL class created from a
document-scoped bookmark data stored in the byte array passed as an
argument, relative to the
baseDocument URL. |
void |
dispose()
Releases the underlying NSURL object.
|
byte[] |
getBookmark()
Returns a byte array representing a persistent bookmark for this URL.
|
byte[] |
getDocumentScopedBookmark(MacFileNSURL baseDocument)
Returns a byte array representing a document-scoped bookmark
for this URL relative to the
baseDocument URL. |
boolean |
startAccessingSecurityScopedResource()
Makes the resource pointed to by a security-scoped URL available to the app.
|
void |
stopAccessingSecurityScopedResource()
Revokes access to the resource pointed to by a security-scoped URL.
|
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
private static void _initIDs()
private void checkNotDisposed()
private void _dispose(long ptr)
public void dispose()
private boolean _startAccessingSecurityScopedResource(long ptr)
public boolean startAccessingSecurityScopedResource()
stopAccessingSecurityScopedResource
using the try{}finally{} pattern.true
if the request to access the resource succeeded; otherwise, false
private void _stopAccessingSecurityScopedResource(long ptr)
public void stopAccessingSecurityScopedResource()
private byte[] _getBookmark(long ptr, long baseDocumentPtr)
public byte[] getBookmark()
createFromBookmark
.private static MacFileNSURL _createFromBookmark(byte[] data, long baseDocumentPtr)
public static MacFileNSURL createFromBookmark(byte[] data)
true
before calling this method.public byte[] getDocumentScopedBookmark(MacFileNSURL baseDocument)
baseDocument
URL.
An app can store this data, and later re-create the URL with a call
to createFromDocumentScopedBookmark
.java.lang.NullPointerException
- if baseDocument is null
public static MacFileNSURL createFromDocumentScopedBookmark(byte[] data, MacFileNSURL baseDocument)
baseDocument
URL.
The glass.macosx.enableFileNSURL system property must be set to true
before calling this method.java.lang.NullPointerException
- if baseDocument is null