Package apple.foundation
Class NSURL
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSURL
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSItemProviderReading,NSItemProviderWriting,NSSecureCoding,NSObject,QLPreviewItem
public class NSURL extends NSObject implements NSSecureCoding, NSCopying, NSItemProviderReading, NSItemProviderWriting, QLPreviewItem
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
Nested classes/interfaces inherited from interface apple.foundation.protocol.NSItemProviderWriting
NSItemProviderWriting.Block_loadDataWithTypeIdentifierForItemProviderCompletionHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSURL(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long_itemProviderVisibilityForRepresentationWithTypeIdentifier_static(java.lang.String typeIdentifier)java.lang.Object_objectWithItemProviderDataTypeIdentifierError(NSData data, java.lang.String typeIdentifier, org.moe.natj.general.ptr.Ptr<NSError> outError)NSArray<java.lang.String>_readableTypeIdentifiersForItemProvider()boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.NSArray<java.lang.String>_writableTypeIdentifiersForItemProvider_static()java.lang.StringabsoluteString()NSURLabsoluteURL()if the receiver is itself absolute, this will return self.static NSURLabsoluteURLWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)Initializes and returns a newly created absolute NSURL using the contents of the given data, relative to a base URL.static booleanaccessInstanceVariablesDirectly()static NSURLalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)NSURLbaseURL()may be nil.static NSDatabookmarkDataWithContentsOfURLError(NSURL bookmarkFileURL, org.moe.natj.general.ptr.Ptr<NSError> error)Initializes and returns bookmark data derived from an alias file pointed to by a specified URL.NSDatabookmarkDataWithOptionsIncludingResourceValuesForKeysRelativeToURLError(long options, NSArray<java.lang.String> keys, NSURL relativeURL, org.moe.natj.general.ptr.Ptr<NSError> error)Returns bookmark data for the URL, created with specified options and resource values.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)booleancheckPromisedItemIsReachableAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> error)booleancheckResourceIsReachableAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> error)Returns whether the URL's resource exists and is reachable.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()java.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)NSDatadataRepresentation()Returns the data representation of the URL's relativeString.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()voidencodeWithCoder(NSCoder coder)NSURLfilePathURL()Returns a file path URL that refers to the same resource as a specified URL.NSURLfileReferenceURL()Returns a file reference URL that refers to the same resource as a specified file URL.java.lang.StringfileSystemRepresentation()Returns the URL's path in file system representation.static NSURLfileURLWithFileSystemRepresentationIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)Initializes and returns a newly created URL referencing the local file or directory at the file system representation of the path.static NSURLfileURLWithPath(java.lang.String path)Better to use fileURLWithPath:isDirectory: if you know if the path is a directory vs non-directory, as it saves an i/o.static NSURLfileURLWithPathComponents(NSArray<java.lang.String> components)The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do.static NSURLfileURLWithPathIsDirectory(java.lang.String path, boolean isDir)static NSURLfileURLWithPathIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)Initializes and returns a newly created file NSURL referencing the local file or directory at path, relative to a base URL.static NSURLfileURLWithPathRelativeToURL(java.lang.String path, NSURL baseURL)Better to use fileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O.java.lang.Stringfragment()booleangetFileSystemRepresentationMaxLength(org.moe.natj.general.ptr.BytePtr buffer, long maxBufferLength)Returns the URL's path in file system representation.booleangetPromisedItemResourceValueForKeyError(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> value, java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> error)Get resource values from URLs of 'promised' items.booleangetResourceValueForKeyError(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> value, java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> error)Returns the resource value identified by a given resource key.booleanhasDirectoryPath()Determines if a given URL string's path represents a directory (i.e. the path component in the URL string ends with a '/' character).static longhash_static()java.lang.Stringhost()If the URL conforms to rfc 1808 (the most common form of URL), the following accessors will return the various components; otherwise they return nil.NSURLinit()NSURLinitAbsoluteURLWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)Initializes a newly created absolute NSURL using the contents of the given data, relative to a base URL.NSURLinitByResolvingBookmarkDataOptionsRelativeToURLBookmarkDataIsStaleError(NSData bookmarkData, long options, NSURL relativeURL, org.moe.natj.general.ptr.BoolPtr isStale, org.moe.natj.general.ptr.Ptr<NSError> error)Initializes a newly created NSURL that refers to a location specified by resolving bookmark data.NSURLinitFileURLWithFileSystemRepresentationIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)Initializes a newly created URL referencing the local file or directory at the file system representation of the path.NSURLinitFileURLWithPath(java.lang.String path)Better to use initFileURLWithPath:isDirectory: if you know if the path is a directory vs non-directory, as it saves an i/o.NSURLinitFileURLWithPathIsDirectory(java.lang.String path, boolean isDir)NSURLinitFileURLWithPathIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)Initializes a newly created file NSURL referencing the local file or directory at path, relative to a base URL.NSURLinitFileURLWithPathRelativeToURL(java.lang.String path, NSURL baseURL)Better to use initFileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O.NSURLinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERNSURLinitWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)Initializes a newly created NSURL using the contents of the given data, relative to a base URL.NSURLinitWithSchemeHostPath(java.lang.String scheme, java.lang.String host, java.lang.String path)Deprecated.NSURLinitWithString(java.lang.String URLString)These methods expect their string arguments to contain any percent escape codes that are necessary.NSURLinitWithStringRelativeToURL(java.lang.String URLString, NSURL baseURL)static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisFileReferenceURL()Returns whether the URL is a file reference URL.booleanisFileURL()Whether the scheme is file:; if [myURL isFileURL] is YES, then [myURL path] is suitable for input into NSFileManager or NSPathUtilities.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)longitemProviderVisibilityForRepresentationWithTypeIdentifier(java.lang.String typeIdentifier)static longitemProviderVisibilityForRepresentationWithTypeIdentifier_static(java.lang.String typeIdentifier)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)java.lang.StringlastPathComponent()NSProgressloadDataWithTypeIdentifierForItemProviderCompletionHandler(java.lang.String typeIdentifier, NSItemProviderWriting.Block_loadDataWithTypeIdentifierForItemProviderCompletionHandler completionHandler)One of writableTypeIdentifiersForItemProviderstatic java.lang.Objectnew_objc()static java.lang.ObjectobjectWithItemProviderDataTypeIdentifierError(NSData data, java.lang.String typeIdentifier, org.moe.natj.general.ptr.Ptr<NSError> outError)java.lang.StringparameterString()java.lang.Stringpassword()java.lang.Stringpath()NSArray<java.lang.String>pathComponents()java.lang.StringpathExtension()NSNumberport()java.lang.StringpreviewItemTitle()The item's title this will be used as apparent item title.NSURLpreviewItemURL()The URL of the item to preview.NSDictionary<java.lang.String,?>promisedItemResourceValuesForKeysError(NSArray<java.lang.String> keys, org.moe.natj.general.ptr.Ptr<NSError> error)java.lang.Stringquery()static NSArray<java.lang.String>readableTypeIdentifiersForItemProvider()java.lang.StringrelativePath()The same as path if baseURL is niljava.lang.StringrelativeString()The relative portion of a URL.voidremoveAllCachedResourceValues()Removes all cached resource values and all temporary resource values from the URL object.voidremoveCachedResourceValueForKey(java.lang.String key)Removes the cached resource value identified by a given resource value key from the URL object.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)java.lang.StringresourceSpecifier()NSDictionary<java.lang.String,?>resourceValuesForKeysError(NSArray<java.lang.String> keys, org.moe.natj.general.ptr.Ptr<NSError> error)Returns the resource values identified by specified array of resource keys.static NSDictionary<java.lang.String,?>resourceValuesForKeysFromBookmarkData(NSArray<java.lang.String> keys, NSData bookmarkData)Returns the resource values for properties identified by a specified array of keys contained in specified bookmark data.java.lang.Stringscheme()Any URL is composed of these two basic pieces.booleansetResourceValueForKeyError(java.lang.Object value, java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> error)Sets the resource value identified by a given resource key.booleansetResourceValuesError(NSDictionary<java.lang.String,?> keyedValues, org.moe.natj.general.ptr.Ptr<NSError> error)Sets any number of resource values of a URL's resource.voidsetTemporaryResourceValueForKey(java.lang.Object value, java.lang.String key)Sets a temporary resource value on the URL object.static voidsetVersion_static(long aVersion)NSURLstandardizedURL()booleanstartAccessingSecurityScopedResource()Given a NSURL created by resolving a bookmark data created with security scope, make the resource referenced by the url accessible to the process.voidstopAccessingSecurityScopedResource()Revokes the access granted to the url by a prior successful call to startAccessingSecurityScopedResource.static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()NSURLURLByAppendingPathComponent(java.lang.String pathComponent)NSURLURLByAppendingPathComponentConformingToType(java.lang.String partialName, UTType contentType)\brief Generate a path component based on a partial filename and a file type, then append it to a copy of the receiver.NSURLURLByAppendingPathComponentIsDirectory(java.lang.String pathComponent, boolean isDirectory)NSURLURLByAppendingPathExtension(java.lang.String pathExtension)NSURLURLByAppendingPathExtensionForType(UTType contentType)\brief Generate a path component based on the last path component of the receiver and a file type, then append it to a copy of the receiver.NSURLURLByDeletingLastPathComponent()NSURLURLByDeletingPathExtension()static NSURLURLByResolvingAliasFileAtURLOptionsError(NSURL url, long options, org.moe.natj.general.ptr.Ptr<NSError> error)Creates and initializes a NSURL that refers to the location specified by resolving the alias file at url.static NSURLURLByResolvingBookmarkDataOptionsRelativeToURLBookmarkDataIsStaleError(NSData bookmarkData, long options, NSURL relativeURL, org.moe.natj.general.ptr.BoolPtr isStale, org.moe.natj.general.ptr.Ptr<NSError> error)Creates and Initializes an NSURL that refers to a location specified by resolving bookmark data.NSURLURLByResolvingSymlinksInPath()NSURLURLByStandardizingPath()The following methods work only on `file:` scheme URLs; for non-`file:` scheme URLs, these methods return the URL unchanged.static NSURLURLWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)Initializes and returns a newly created NSURL using the contents of the given data, relative to a base URL.static NSURLURLWithString(java.lang.String URLString)static NSURLURLWithStringRelativeToURL(java.lang.String URLString, NSURL baseURL)java.lang.Stringuser()static longversion_static()NSArray<java.lang.String>writableTypeIdentifiersForItemProvider()static NSArray<java.lang.String>writableTypeIdentifiersForItemProvider_static()static booleanwriteBookmarkDataToURLOptionsError(NSData bookmarkData, NSURL bookmarkFileURL, long options, org.moe.natj.general.ptr.Ptr<NSError> error)Creates an alias file on disk at a specified location with specified bookmark data. bookmarkData must have been created with the NSURLBookmarkCreationSuitableForBookmarkFile option. bookmarkFileURL must either refer to an existing file (which will be overwritten), or to location in an existing directory.-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
URLByResolvingAliasFileAtURLOptionsError
public static NSURL URLByResolvingAliasFileAtURLOptionsError(NSURL url, long options, org.moe.natj.general.ptr.Ptr<NSError> error)
Creates and initializes a NSURL that refers to the location specified by resolving the alias file at url. If the url argument does not refer to an alias file as defined by the NSURLIsAliasFileKey property, the NSURL returned is the same as url argument. This method fails and returns nil if the url argument is unreachable, or if the original file or directory could not be located or is not reachable, or if the original file or directory is on a volume that could not be located or mounted. If this method fails, the optional error is populated. The NSURLBookmarkResolutionWithSecurityScope option is not supported by this method.
-
URLByResolvingBookmarkDataOptionsRelativeToURLBookmarkDataIsStaleError
public static NSURL URLByResolvingBookmarkDataOptionsRelativeToURLBookmarkDataIsStaleError(NSData bookmarkData, long options, NSURL relativeURL, org.moe.natj.general.ptr.BoolPtr isStale, org.moe.natj.general.ptr.Ptr<NSError> error)
Creates and Initializes an NSURL that refers to a location specified by resolving bookmark data. If this method returns nil, the optional error is populated.
-
URLWithDataRepresentationRelativeToURL
public static NSURL URLWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)
Initializes and returns a newly created NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected.
-
URLWithString
public static NSURL URLWithString(java.lang.String URLString)
-
URLWithStringRelativeToURL
public static NSURL URLWithStringRelativeToURL(java.lang.String URLString, NSURL baseURL)
-
absoluteURLWithDataRepresentationRelativeToURL
public static NSURL absoluteURLWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)
Initializes and returns a newly created absolute NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected.
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSURL alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
bookmarkDataWithContentsOfURLError
public static NSData bookmarkDataWithContentsOfURLError(NSURL bookmarkFileURL, org.moe.natj.general.ptr.Ptr<NSError> error)
Initializes and returns bookmark data derived from an alias file pointed to by a specified URL. If bookmarkFileURL refers to an alias file created prior to OS X v10.6 that contains Alias Manager information but no bookmark data, this method synthesizes bookmark data for the file. If this method returns nil, the optional error is populated.
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
fileURLWithFileSystemRepresentationIsDirectoryRelativeToURL
public static NSURL fileURLWithFileSystemRepresentationIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)
Initializes and returns a newly created URL referencing the local file or directory at the file system representation of the path. File system representation is a null-terminated C string with canonical UTF-8 encoding.
-
fileURLWithPath
public static NSURL fileURLWithPath(java.lang.String path)
Better to use fileURLWithPath:isDirectory: if you know if the path is a directory vs non-directory, as it saves an i/o.
-
fileURLWithPathIsDirectory
public static NSURL fileURLWithPathIsDirectory(java.lang.String path, boolean isDir)
-
fileURLWithPathIsDirectoryRelativeToURL
public static NSURL fileURLWithPathIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)
Initializes and returns a newly created file NSURL referencing the local file or directory at path, relative to a base URL.
-
fileURLWithPathRelativeToURL
public static NSURL fileURLWithPathRelativeToURL(java.lang.String path, NSURL baseURL)
Better to use fileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O.
-
fileURLWithPathComponents
public static NSURL fileURLWithPathComponents(NSArray<java.lang.String> components)
The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do.
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
resourceValuesForKeysFromBookmarkData
public static NSDictionary<java.lang.String,?> resourceValuesForKeysFromBookmarkData(NSArray<java.lang.String> keys, NSData bookmarkData)
Returns the resource values for properties identified by a specified array of keys contained in specified bookmark data. If the result dictionary does not contain a resource value for one or more of the requested resource keys, it means those resource properties are not available in the bookmark data.
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
version_static
public static long version_static()
-
writeBookmarkDataToURLOptionsError
public static boolean writeBookmarkDataToURLOptionsError(NSData bookmarkData, NSURL bookmarkFileURL, long options, org.moe.natj.general.ptr.Ptr<NSError> error)
Creates an alias file on disk at a specified location with specified bookmark data. bookmarkData must have been created with the NSURLBookmarkCreationSuitableForBookmarkFile option. bookmarkFileURL must either refer to an existing file (which will be overwritten), or to location in an existing directory. If this method returns NO, the optional error is populated.
-
URLByAppendingPathComponent
public NSURL URLByAppendingPathComponent(java.lang.String pathComponent)
-
URLByAppendingPathComponentIsDirectory
public NSURL URLByAppendingPathComponentIsDirectory(java.lang.String pathComponent, boolean isDirectory)
-
URLByAppendingPathExtension
public NSURL URLByAppendingPathExtension(java.lang.String pathExtension)
-
URLByDeletingLastPathComponent
public NSURL URLByDeletingLastPathComponent()
-
URLByDeletingPathExtension
public NSURL URLByDeletingPathExtension()
-
URLByResolvingSymlinksInPath
public NSURL URLByResolvingSymlinksInPath()
-
URLByStandardizingPath
public NSURL URLByStandardizingPath()
The following methods work only on `file:` scheme URLs; for non-`file:` scheme URLs, these methods return the URL unchanged.
-
absoluteString
public java.lang.String absoluteString()
-
absoluteURL
public NSURL absoluteURL()
if the receiver is itself absolute, this will return self.
-
baseURL
public NSURL baseURL()
may be nil.
-
bookmarkDataWithOptionsIncludingResourceValuesForKeysRelativeToURLError
public NSData bookmarkDataWithOptionsIncludingResourceValuesForKeysRelativeToURLError(long options, NSArray<java.lang.String> keys, NSURL relativeURL, org.moe.natj.general.ptr.Ptr<NSError> error)
Returns bookmark data for the URL, created with specified options and resource values. If this method returns nil, the optional error is populated.
-
checkPromisedItemIsReachableAndReturnError
public boolean checkPromisedItemIsReachableAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> error)
-
checkResourceIsReachableAndReturnError
public boolean checkResourceIsReachableAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> error)
Returns whether the URL's resource exists and is reachable. This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. For other URL types, NO is returned. Symbol is present in iOS 4, but performs no operation.
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
dataRepresentation
public NSData dataRepresentation()
Returns the data representation of the URL's relativeString. If the URL was initialized with -initWithData:relativeToURL:, the data representation returned are the same bytes as those used at initialization; otherwise, the data representation returned are the bytes of the relativeString encoded with NSUTF8StringEncoding.
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
filePathURL
public NSURL filePathURL()
Returns a file path URL that refers to the same resource as a specified URL. File path URLs use a file system style path. An error will occur if the url parameter is not a file URL. A file reference URL's resource must exist and be reachable to be converted to a file path URL. Symbol is present in iOS 4, but performs no operation.
-
fileReferenceURL
public NSURL fileReferenceURL()
Returns a file reference URL that refers to the same resource as a specified file URL. File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URL’s underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark (see -bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:). Symbol is present in iOS 4, but performs no operation.
-
fileSystemRepresentation
public java.lang.String fileSystemRepresentation()
Returns the URL's path in file system representation. File system representation is a null-terminated C string with canonical UTF-8 encoding. The returned C string will be automatically freed just as a returned object would be released; your code should copy the representation or use getFileSystemRepresentation:maxLength: if it needs to store the representation outside of the autorelease context in which the representation is created.
-
fragment
public java.lang.String fragment()
-
getFileSystemRepresentationMaxLength
public boolean getFileSystemRepresentationMaxLength(org.moe.natj.general.ptr.BytePtr buffer, long maxBufferLength)Returns the URL's path in file system representation. File system representation is a null-terminated C string with canonical UTF-8 encoding.
-
getPromisedItemResourceValueForKeyError
public boolean getPromisedItemResourceValueForKeyError(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> value, java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> error)Get resource values from URLs of 'promised' items. A promised item is not guaranteed to have its contents in the file system until you use NSFileCoordinator to perform a coordinated read on its URL, which causes the contents to be downloaded or otherwise generated. Promised item URLs are returned by various APIs, including currently: - NSMetadataQueryUbiquitousDataScope - NSMetadataQueryUbiquitousDocumentsScope - An NSFilePresenter presenting the contents of the directory located by -URLForUbiquitousContainerIdentifier: or a subdirectory thereof The following methods behave identically to their similarly named methods above (-getResourceValue:forKey:error:, etc.), except that they allow you to get resource values and check for presence regardless of whether the promised item's contents currently exist at the URL. You must use these APIs instead of the normal NSURL resource value APIs if and only if any of the following are true: - You are using a URL that you know came directly from one of the above APIs - You are inside the accessor block of a coordinated read or write that used NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly, NSFileCoordinatorWritingForDeleting, NSFileCoordinatorWritingForMoving, or NSFileCoordinatorWritingContentIndependentMetadataOnly Most of the NSURL resource value keys will work with these APIs. However, there are some that are tied to the item's contents that will not work, such as NSURLContentAccessDateKey or NSURLGenerationIdentifierKey. If one of these keys is used, the method will return YES, but the value for the key will be nil.
-
getResourceValueForKeyError
public boolean getResourceValueForKeyError(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> value, java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> error)Returns the resource value identified by a given resource key. This method first checks if the URL object already caches the resource value. If so, it returns the cached resource value to the caller. If not, then this method synchronously obtains the resource value from the backing store, adds the resource value to the URL object's cache, and returns the resource value to the caller. The type of the resource value varies by resource property (see resource key definitions). If this method returns YES and value is populated with nil, it means the resource property is not available for the specified resource and no errors occurred when determining the resource property was not available. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation.
-
hasDirectoryPath
public boolean hasDirectoryPath()
Determines if a given URL string's path represents a directory (i.e. the path component in the URL string ends with a '/' character). This does not check the resource the URL refers to.
-
host
public java.lang.String host()
If the URL conforms to rfc 1808 (the most common form of URL), the following accessors will return the various components; otherwise they return nil. The litmus test for conformance is as recommended in RFC 1808 - whether the first two characters of resourceSpecifier is @"//". In all cases, they return the component's value after resolving the receiver against its base URL.
-
initAbsoluteURLWithDataRepresentationRelativeToURL
public NSURL initAbsoluteURLWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)
Initializes a newly created absolute NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected.
-
initByResolvingBookmarkDataOptionsRelativeToURLBookmarkDataIsStaleError
public NSURL initByResolvingBookmarkDataOptionsRelativeToURLBookmarkDataIsStaleError(NSData bookmarkData, long options, NSURL relativeURL, org.moe.natj.general.ptr.BoolPtr isStale, org.moe.natj.general.ptr.Ptr<NSError> error)
Initializes a newly created NSURL that refers to a location specified by resolving bookmark data. If this method returns nil, the optional error is populated.
-
initFileURLWithFileSystemRepresentationIsDirectoryRelativeToURL
public NSURL initFileURLWithFileSystemRepresentationIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)
Initializes a newly created URL referencing the local file or directory at the file system representation of the path. File system representation is a null-terminated C string with canonical UTF-8 encoding.
-
initFileURLWithPath
public NSURL initFileURLWithPath(java.lang.String path)
Better to use initFileURLWithPath:isDirectory: if you know if the path is a directory vs non-directory, as it saves an i/o.
-
initFileURLWithPathIsDirectory
public NSURL initFileURLWithPathIsDirectory(java.lang.String path, boolean isDir)
-
initFileURLWithPathIsDirectoryRelativeToURL
public NSURL initFileURLWithPathIsDirectoryRelativeToURL(java.lang.String path, boolean isDir, NSURL baseURL)
Initializes a newly created file NSURL referencing the local file or directory at path, relative to a base URL.
-
initFileURLWithPathRelativeToURL
public NSURL initFileURLWithPathRelativeToURL(java.lang.String path, NSURL baseURL)
Better to use initFileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O.
-
initWithCoder
public NSURL initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithDataRepresentationRelativeToURL
public NSURL initWithDataRepresentationRelativeToURL(NSData data, NSURL baseURL)
Initializes a newly created NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected.
-
initWithSchemeHostPath
@Deprecated public NSURL initWithSchemeHostPath(java.lang.String scheme, java.lang.String host, java.lang.String path)
Deprecated.this call percent-encodes both the host and path, so this cannot be used to set a username/password or port in the hostname part or with a IPv6 '[...]' type address. NSURLComponents handles IPv6 addresses correctly.
-
initWithString
public NSURL initWithString(java.lang.String URLString)
These methods expect their string arguments to contain any percent escape codes that are necessary. It is an error for URLString to be nil.
-
initWithStringRelativeToURL
public NSURL initWithStringRelativeToURL(java.lang.String URLString, NSURL baseURL)
-
isFileReferenceURL
public boolean isFileReferenceURL()
Returns whether the URL is a file reference URL. Symbol is present in iOS 4, but performs no operation.
-
isFileURL
public boolean isFileURL()
Whether the scheme is file:; if [myURL isFileURL] is YES, then [myURL path] is suitable for input into NSFileManager or NSPathUtilities.
-
lastPathComponent
public java.lang.String lastPathComponent()
-
parameterString
public java.lang.String parameterString()
-
password
public java.lang.String password()
-
path
public java.lang.String path()
-
pathComponents
public NSArray<java.lang.String> pathComponents()
-
pathExtension
public java.lang.String pathExtension()
-
port
public NSNumber port()
-
previewItemTitle
public java.lang.String previewItemTitle()
Description copied from interface:QLPreviewItemThe item's title this will be used as apparent item title. The title replaces the default item display name. This property is optional.- Specified by:
previewItemTitlein interfaceQLPreviewItem
-
previewItemURL
public NSURL previewItemURL()
Description copied from interface:QLPreviewItemThe URL of the item to preview. The URL must be a file URL.- Specified by:
previewItemURLin interfaceQLPreviewItem
-
promisedItemResourceValuesForKeysError
public NSDictionary<java.lang.String,?> promisedItemResourceValuesForKeysError(NSArray<java.lang.String> keys, org.moe.natj.general.ptr.Ptr<NSError> error)
-
query
public java.lang.String query()
-
relativePath
public java.lang.String relativePath()
The same as path if baseURL is nil
-
relativeString
public java.lang.String relativeString()
The relative portion of a URL. If baseURL is nil, or if the receiver is itself absolute, this is the same as absoluteString
-
removeAllCachedResourceValues
public void removeAllCachedResourceValues()
Removes all cached resource values and all temporary resource values from the URL object. This method is currently applicable only to URLs for file system resources.
-
removeCachedResourceValueForKey
public void removeCachedResourceValueForKey(java.lang.String key)
Removes the cached resource value identified by a given resource value key from the URL object. Removing a cached resource value may remove other cached resource values because some resource values are cached as a set of values, and because some resource values depend on other resource values (temporary resource values have no dependencies). This method is currently applicable only to URLs for file system resources.
-
resourceSpecifier
public java.lang.String resourceSpecifier()
-
resourceValuesForKeysError
public NSDictionary<java.lang.String,?> resourceValuesForKeysError(NSArray<java.lang.String> keys, org.moe.natj.general.ptr.Ptr<NSError> error)
Returns the resource values identified by specified array of resource keys. This method first checks if the URL object already caches the resource values. If so, it returns the cached resource values to the caller. If not, then this method synchronously obtains the resource values from the backing store, adds the resource values to the URL object's cache, and returns the resource values to the caller. The type of the resource values vary by property (see resource key definitions). If the result dictionary does not contain a resource value for one or more of the requested resource keys, it means those resource properties are not available for the specified resource and no errors occurred when determining those resource properties were not available. If this method returns NULL, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation.
-
scheme
public java.lang.String scheme()
Any URL is composed of these two basic pieces. The full URL would be the concatenation of [myURL scheme], ':', [myURL resourceSpecifier]
-
setResourceValueForKeyError
public boolean setResourceValueForKeyError(java.lang.Object value, java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> error)Sets the resource value identified by a given resource key. This method writes the new resource value out to the backing store. Attempts to set a read-only resource property or to set a resource property not supported by the resource are ignored and are not considered errors. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation.
-
setResourceValuesError
public boolean setResourceValuesError(NSDictionary<java.lang.String,?> keyedValues, org.moe.natj.general.ptr.Ptr<NSError> error)
Sets any number of resource values of a URL's resource. This method writes the new resource values out to the backing store. Attempts to set read-only resource properties or to set resource properties not supported by the resource are ignored and are not considered errors. If an error occurs after some resource properties have been successfully changed, the userInfo dictionary in the returned error contains an array of resource keys that were not set with the key kCFURLKeysOfUnsetValuesKey. The order in which the resource values are set is not defined. If you need to guarantee the order resource values are set, you should make multiple requests to this method or to -setResourceValue:forKey:error: to guarantee the order. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation.
-
setTemporaryResourceValueForKey
public void setTemporaryResourceValueForKey(java.lang.Object value, java.lang.String key)Sets a temporary resource value on the URL object. Temporary resource values are for client use. Temporary resource values exist only in memory and are never written to the resource's backing store. Once set, a temporary resource value can be copied from the URL object with -getResourceValue:forKey:error: or -resourceValuesForKeys:error:. To remove a temporary resource value from the URL object, use -removeCachedResourceValueForKey:. Care should be taken to ensure the key that identifies a temporary resource value is unique and does not conflict with system defined keys (using reverse domain name notation in your temporary resource value keys is recommended). This method is currently applicable only to URLs for file system resources.
-
standardizedURL
public NSURL standardizedURL()
-
startAccessingSecurityScopedResource
public boolean startAccessingSecurityScopedResource()
Given a NSURL created by resolving a bookmark data created with security scope, make the resource referenced by the url accessible to the process. When access to this resource is no longer needed the client must call stopAccessingSecurityScopedResource. Each call to startAccessingSecurityScopedResource must be balanced with a call to stopAccessingSecurityScopedResource (Note: this is not reference counted).
-
stopAccessingSecurityScopedResource
public void stopAccessingSecurityScopedResource()
Revokes the access granted to the url by a prior successful call to startAccessingSecurityScopedResource.
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding
-
user
public java.lang.String user()
-
itemProviderVisibilityForRepresentationWithTypeIdentifier_static
public static long itemProviderVisibilityForRepresentationWithTypeIdentifier_static(java.lang.String typeIdentifier)
-
_itemProviderVisibilityForRepresentationWithTypeIdentifier_static
public long _itemProviderVisibilityForRepresentationWithTypeIdentifier_static(java.lang.String typeIdentifier)
- Specified by:
_itemProviderVisibilityForRepresentationWithTypeIdentifier_staticin interfaceNSItemProviderWriting
-
itemProviderVisibilityForRepresentationWithTypeIdentifier
public long itemProviderVisibilityForRepresentationWithTypeIdentifier(java.lang.String typeIdentifier)
-
loadDataWithTypeIdentifierForItemProviderCompletionHandler
public NSProgress loadDataWithTypeIdentifierForItemProviderCompletionHandler(java.lang.String typeIdentifier, NSItemProviderWriting.Block_loadDataWithTypeIdentifierForItemProviderCompletionHandler completionHandler)
Description copied from interface:NSItemProviderWritingOne of writableTypeIdentifiersForItemProvider- Specified by:
loadDataWithTypeIdentifierForItemProviderCompletionHandlerin interfaceNSItemProviderWriting
-
objectWithItemProviderDataTypeIdentifierError
public static java.lang.Object objectWithItemProviderDataTypeIdentifierError(NSData data, java.lang.String typeIdentifier, org.moe.natj.general.ptr.Ptr<NSError> outError)
-
_objectWithItemProviderDataTypeIdentifierError
public java.lang.Object _objectWithItemProviderDataTypeIdentifierError(NSData data, java.lang.String typeIdentifier, org.moe.natj.general.ptr.Ptr<NSError> outError)
- Specified by:
_objectWithItemProviderDataTypeIdentifierErrorin interfaceNSItemProviderReading
-
readableTypeIdentifiersForItemProvider
public static NSArray<java.lang.String> readableTypeIdentifiersForItemProvider()
-
_readableTypeIdentifiersForItemProvider
public NSArray<java.lang.String> _readableTypeIdentifiersForItemProvider()
- Specified by:
_readableTypeIdentifiersForItemProviderin interfaceNSItemProviderReading
-
writableTypeIdentifiersForItemProvider_static
public static NSArray<java.lang.String> writableTypeIdentifiersForItemProvider_static()
-
_writableTypeIdentifiersForItemProvider_static
public NSArray<java.lang.String> _writableTypeIdentifiersForItemProvider_static()
- Specified by:
_writableTypeIdentifiersForItemProvider_staticin interfaceNSItemProviderWriting
-
writableTypeIdentifiersForItemProvider
public NSArray<java.lang.String> writableTypeIdentifiersForItemProvider()
-
URLByAppendingPathComponentConformingToType
public NSURL URLByAppendingPathComponentConformingToType(java.lang.String partialName, UTType contentType)
\brief Generate a path component based on a partial filename and a file type, then append it to a copy of the receiver. \param partialName The partial filename that should be expanded upon, e.g. \c "readme". \param contentType The type the resulting file should conform to, e.g. \c UTTypePlainText. \result A complete URL. Using the argument examples above, this method would return a URL with a last path component of \c "readme.txt". Use this method when you have partial input from a user or other source and need to produce a complete filename suitable for that input. For example, if you are downloading a file from the Internet and know its MIME type, you can use this method to ensure the correct filename extension is applied to the URL where you save the file. If \a partialName already has a path extension, and that path extension is valid for file system objects of type \a contentType, no additional extension is appended to the path component before constructing the URL. For example, if the inputs are \c "puppy.jpg" and \c UTTypeImage respectively, then the resulting URL will have a last path component of \c "puppy.jpg" . On the other hand, if the inputs are \c "puppy.jpg" and \c UTTypePlainText respectively, the resulting URL will have a last path component of \c "puppy.jpg.txt" . If you want to ensure any existing path extension is replaced, you can use the \c URLByDeletingPathExtension property first. If the path component could not be appended, this method returns a copy of \c self . \note The resulting URL has a directory path if \c contentType conforms to \c UTTypeDirectory .
-
URLByAppendingPathExtensionForType
public NSURL URLByAppendingPathExtensionForType(UTType contentType)
\brief Generate a path component based on the last path component of the receiver and a file type, then append it to a copy of the receiver. \param contentType The type the resulting file should conform to, e.g. \c UTTypePlainText. \result A complete URL. Using the argument example above and assuming the receiver equals \c "file:///readme" , this method would return \c "file:///readme.txt". Use this method when you have partial input from a user or other source and need to produce a complete filename suitable for that input. For example, if you are downloading a file from the Internet and know its MIME type, you can use this method to ensure the correct filename extension is applied to the URL where you save the file. If the receiver already has a path extension, and that path extension is valid for file system objects of type \a contentType, no additional extension is appended to the path component before constructing the URL. For example, if the receiver's last path component equals \c "puppy.jpg" and \a contentType equals \c UTTypeImage , then the resulting URL will have a last path component of \c "puppy.jpg" . On the other hand, if the inputs are \c "puppy.jpg" and \c UTTypePlainText respectively, the resulting URL will have a last path component of \c "puppy.jpg.txt" . If you want to ensure any existing path extension is replaced, you can use the \c URLByDeletingPathExtension property first. If the extension could not be appended, this method returns a copy of \c self . \note The resulting URL has a directory path if \c contentType conforms to \c UTTypeDirectory .
-
-