Class NSFileManager

  • All Implemented Interfaces:
    NSObject

    public class NSFileManager
    extends NSObject
    • Constructor Detail

      • NSFileManager

        protected NSFileManager​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • 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()
      • defaultManager

        public static NSFileManager defaultManager()
        Returns the default singleton instance.
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • 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)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • URLForDirectoryInDomainAppropriateForURLCreateError

        public NSURL URLForDirectoryInDomainAppropriateForURLCreateError​(long directory,
                                                                         long domain,
                                                                         NSURL url,
                                                                         boolean shouldCreate,
                                                                         org.moe.natj.general.ptr.Ptr<NSError> error)
        -URLForDirectory:inDomain:appropriateForURL:create:error: is a URL-based replacement for FSFindFolder(). It allows for the specification and (optional) creation of a specific directory for a particular purpose (e.g. the replacement of a particular item on disk, or a particular Library directory. You may pass only one of the values from the NSSearchPathDomainMask enumeration, and you may not pass NSAllDomainsMask.
      • URLForPublishingUbiquitousItemAtURLExpirationDateError

        public NSURL URLForPublishingUbiquitousItemAtURLExpirationDateError​(NSURL url,
                                                                            org.moe.natj.general.ptr.Ptr<NSDate> outDate,
                                                                            org.moe.natj.general.ptr.Ptr<NSError> error)
        Returns a URL that can be shared with other users to allow them download a copy of the specified ubiquitous item. Also returns the date after which the item will no longer be accessible at the returned URL. The URL must be prefixed with a URL from -URLForUbiquityContainerIdentifier:.
      • URLForUbiquityContainerIdentifier

        public NSURL URLForUbiquityContainerIdentifier​(java.lang.String containerIdentifier)
        Returns a file URL for the root of the ubiquity container directory corresponding to the supplied container ID. Returns nil if the mobile container does not exist or could not be determined.
      • URLsForDirectoryInDomains

        public NSArray<? extends NSURL> URLsForDirectoryInDomains​(long directory,
                                                                  long domainMask)
        -URLsForDirectory:inDomains: is analogous to NSSearchPathForDirectoriesInDomains(), but returns an array of NSURL instances for use with URL-taking APIs. This API is suitable when you need to search for a file or files which may live in one of a variety of locations in the domains specified.
      • attributesOfFileSystemForPathError

        public NSDictionary<java.lang.String,​?> attributesOfFileSystemForPathError​(java.lang.String path,
                                                                                         org.moe.natj.general.ptr.Ptr<NSError> error)
        attributesOfFileSystemForPath:error: returns an NSDictionary of key/value pairs containing the attributes of the filesystem containing the provided path. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink. This method replaces fileSystemAttributesAtPath:.
      • attributesOfItemAtPathError

        public NSDictionary<java.lang.String,​?> attributesOfItemAtPathError​(java.lang.String path,
                                                                                  org.moe.natj.general.ptr.Ptr<NSError> error)
        attributesOfItemAtPath:error: returns an NSDictionary of key/value pairs containing the attributes of the item (file, directory, symlink, etc.) at the path in question. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink. This method replaces fileAttributesAtPath:traverseLink:.
      • changeCurrentDirectoryPath

        public boolean changeCurrentDirectoryPath​(java.lang.String path)
      • changeFileAttributesAtPath

        @Deprecated
        public boolean changeFileAttributesAtPath​(NSDictionary<?,​?> attributes,
                                                  java.lang.String path)
        Deprecated.
      • componentsToDisplayForPath

        public NSArray<java.lang.String> componentsToDisplayForPath​(java.lang.String path)
        componentsToDisplayForPath: returns an NSArray of display names for the path provided. Localization will occur as in displayNameAtPath: above. This array cannot and should not be reassembled into an usable filesystem path for any kind of access.
      • containerURLForSecurityApplicationGroupIdentifier

        public NSURL containerURLForSecurityApplicationGroupIdentifier​(java.lang.String groupIdentifier)
        Available for OS X in 10.8.3.
      • contentsAtPath

        public NSData contentsAtPath​(java.lang.String path)
        These methods are provided here for compatibility. The corresponding methods on NSData which return NSErrors should be regarded as the primary method of creating a file from an NSData or retrieving the contents of a file as an NSData.
      • contentsEqualAtPathAndPath

        public boolean contentsEqualAtPathAndPath​(java.lang.String path1,
                                                  java.lang.String path2)
        -contentsEqualAtPath:andPath: does not take into account data stored in the resource fork or filesystem extended attributes.
      • contentsOfDirectoryAtPathError

        public NSArray<java.lang.String> contentsOfDirectoryAtPathError​(java.lang.String path,
                                                                        org.moe.natj.general.ptr.Ptr<NSError> error)
        contentsOfDirectoryAtPath:error: returns an NSArray of NSStrings representing the filenames of the items in the directory. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. If the directory contains no items, this method will return the empty array. This method replaces directoryContentsAtPath:
      • contentsOfDirectoryAtURLIncludingPropertiesForKeysOptionsError

        public NSArray<? extends NSURL> contentsOfDirectoryAtURLIncludingPropertiesForKeysOptionsError​(NSURL url,
                                                                                                       NSArray<java.lang.String> keys,
                                                                                                       long mask,
                                                                                                       org.moe.natj.general.ptr.Ptr<NSError> error)
        -contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: returns an NSArray of NSURLs identifying the the directory entries. If this method returns nil, an NSError will be returned by reference in the 'error' parameter. If the directory contains no entries, this method will return the empty array. When an array is specified for the 'keys' parameter, the specified property values will be pre-fetched and cached with each enumerated URL. This method always does a shallow enumeration of the specified directory (i.e. it always acts as if NSDirectoryEnumerationSkipsSubdirectoryDescendants has been specified). If you need to perform a deep enumeration, use -[NSFileManager enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:]. If you wish to only receive the URLs and no other attributes, then pass '0' for 'options' and an empty NSArray ('[NSArray array]') for 'keys'. If you wish to have the property caches of the vended URLs pre-populated with a default set of attributes, then pass '0' for 'options' and 'nil' for 'keys'.
      • copyItemAtPathToPathError

        public boolean copyItemAtPathToPathError​(java.lang.String srcPath,
                                                 java.lang.String dstPath,
                                                 org.moe.natj.general.ptr.Ptr<NSError> error)
        These methods replace their non-error returning counterparts below. See the NSFileManagerDelegate protocol below for methods that are dispatched to the NSFileManager instance's delegate.
      • copyItemAtURLToURLError

        public boolean copyItemAtURLToURLError​(NSURL srcURL,
                                               NSURL dstURL,
                                               org.moe.natj.general.ptr.Ptr<NSError> error)
        These methods are URL-taking equivalents of the four methods above. Their delegate methods are defined in the NSFileManagerDelegate protocol below.
      • createDirectoryAtPathAttributes

        @Deprecated
        public boolean createDirectoryAtPathAttributes​(java.lang.String path,
                                                       NSDictionary<?,​?> attributes)
        Deprecated.
      • createDirectoryAtPathWithIntermediateDirectoriesAttributesError

        public boolean createDirectoryAtPathWithIntermediateDirectoriesAttributesError​(java.lang.String path,
                                                                                       boolean createIntermediates,
                                                                                       NSDictionary<java.lang.String,​?> attributes,
                                                                                       org.moe.natj.general.ptr.Ptr<NSError> error)
        createDirectoryAtPath:withIntermediateDirectories:attributes:error: creates a directory at the specified path. If you pass 'NO' for createIntermediates, the directory must not exist at the time this call is made. Passing 'YES' for 'createIntermediates' will create any necessary intermediate directories. This method returns YES if all directories specified in 'path' were created and attributes were set. Directories are created with attributes specified by the dictionary passed to 'attributes'. If no dictionary is supplied, directories are created according to the umask of the process. This method returns NO if a failure occurs at any stage of the operation. If an error parameter was provided, a presentable NSError will be returned by reference. This method replaces createDirectoryAtPath:attributes:
      • createDirectoryAtURLWithIntermediateDirectoriesAttributesError

        public boolean createDirectoryAtURLWithIntermediateDirectoriesAttributesError​(NSURL url,
                                                                                      boolean createIntermediates,
                                                                                      NSDictionary<java.lang.String,​?> attributes,
                                                                                      org.moe.natj.general.ptr.Ptr<NSError> error)
        createDirectoryAtURL:withIntermediateDirectories:attributes:error: creates a directory at the specified URL. If you pass 'NO' for withIntermediateDirectories, the directory must not exist at the time this call is made. Passing 'YES' for withIntermediateDirectories will create any necessary intermediate directories. This method returns YES if all directories specified in 'url' were created and attributes were set. Directories are created with attributes specified by the dictionary passed to 'attributes'. If no dictionary is supplied, directories are created according to the umask of the process. This method returns NO if a failure occurs at any stage of the operation. If an error parameter was provided, a presentable NSError will be returned by reference.
      • createFileAtPathContentsAttributes

        public boolean createFileAtPathContentsAttributes​(java.lang.String path,
                                                          NSData data,
                                                          NSDictionary<java.lang.String,​?> attr)
      • createSymbolicLinkAtPathPathContent

        @Deprecated
        public boolean createSymbolicLinkAtPathPathContent​(java.lang.String path,
                                                           java.lang.String otherpath)
        Deprecated.
      • createSymbolicLinkAtPathWithDestinationPathError

        public boolean createSymbolicLinkAtPathWithDestinationPathError​(java.lang.String path,
                                                                        java.lang.String destPath,
                                                                        org.moe.natj.general.ptr.Ptr<NSError> error)
        createSymbolicLinkAtPath:withDestination:error: returns YES if the symbolic link that point at 'destPath' was able to be created at the location specified by 'path'. If this method returns NO, the link was unable to be created and an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink. This method replaces createSymbolicLinkAtPath:pathContent:
      • createSymbolicLinkAtURLWithDestinationURLError

        public boolean createSymbolicLinkAtURLWithDestinationURLError​(NSURL url,
                                                                      NSURL destURL,
                                                                      org.moe.natj.general.ptr.Ptr<NSError> error)
        createSymbolicLinkAtURL:withDestinationURL:error: returns YES if the symbolic link that point at 'destURL' was able to be created at the location specified by 'url'. 'destURL' is always resolved against its base URL, if it has one. If 'destURL' has no base URL and it's 'relativePath' is indeed a relative path, then a relative symlink will be created. If this method returns NO, the link was unable to be created and an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
      • currentDirectoryPath

        public java.lang.String currentDirectoryPath()
        Process working directory management. Despite the fact that these are instance methods on NSFileManager, these methods report and change (respectively) the working directory for the entire process. Developers are cautioned that doing so is fraught with peril.
      • delegate

        public NSFileManagerDelegate delegate()
        Instances of NSFileManager may now have delegates. Each instance has one delegate, and the delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of an NSFileManager.
      • destinationOfSymbolicLinkAtPathError

        public java.lang.String destinationOfSymbolicLinkAtPathError​(java.lang.String path,
                                                                     org.moe.natj.general.ptr.Ptr<NSError> error)
        destinationOfSymbolicLinkAtPath:error: returns an NSString containing the path of the item pointed at by the symlink specified by 'path'. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. This method replaces pathContentOfSymbolicLinkAtPath:
      • directoryContentsAtPath

        @Deprecated
        public NSArray<?> directoryContentsAtPath​(java.lang.String path)
        Deprecated.
      • displayNameAtPath

        public java.lang.String displayNameAtPath​(java.lang.String path)
        displayNameAtPath: returns an NSString suitable for presentation to the user. For directories which have localization information, this will return the appropriate localized string. This string is not suitable for passing to anything that must interact with the filesystem.
      • enumeratorAtPath

        public NSDirectoryEnumerator<java.lang.String> enumeratorAtPath​(java.lang.String path)
        enumeratorAtPath: returns an NSDirectoryEnumerator rooted at the provided path. If the enumerator cannot be created, this returns NULL. Because NSDirectoryEnumerator is a subclass of NSEnumerator, the returned object can be used in the for...in construct.
      • enumeratorAtURLIncludingPropertiesForKeysOptionsErrorHandler

        public NSDirectoryEnumerator<NSURL> enumeratorAtURLIncludingPropertiesForKeysOptionsErrorHandler​(NSURL url,
                                                                                                         NSArray<java.lang.String> keys,
                                                                                                         long mask,
                                                                                                         NSFileManager.Block_enumeratorAtURLIncludingPropertiesForKeysOptionsErrorHandler handler)
        enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: returns an NSDirectoryEnumerator rooted at the provided directory URL. The NSDirectoryEnumerator returns NSURLs from the -nextObject method. The optional 'includingPropertiesForKeys' parameter indicates which resource properties should be pre-fetched and cached with each enumerated URL. The optional 'errorHandler' block argument is invoked when an error occurs. Parameters to the block are the URL on which an error occurred and the error. When the error handler returns YES, enumeration continues if possible. Enumeration stops immediately when the error handler returns NO. If you wish to only receive the URLs and no other attributes, then pass '0' for 'options' and an empty NSArray ('[NSArray array]') for 'keys'. If you wish to have the property caches of the vended URLs pre-populated with a default set of attributes, then pass '0' for 'options' and 'nil' for 'keys'.
      • evictUbiquitousItemAtURLError

        public boolean evictUbiquitousItemAtURLError​(NSURL url,
                                                     org.moe.natj.general.ptr.Ptr<NSError> error)
        Removes the local instance of the ubiquitous item at the given URL. Returns YES if removal was successful, NO otherwise.
      • fileAttributesAtPathTraverseLink

        @Deprecated
        public NSDictionary<?,​?> fileAttributesAtPathTraverseLink​(java.lang.String path,
                                                                        boolean yorn)
        Deprecated.
        The following methods are deprecated on Mac OS X 10.5. Their URL-based and/or error-returning replacements are listed above.
      • fileExistsAtPath

        public boolean fileExistsAtPath​(java.lang.String path)
        The following methods are of limited utility. Attempting to predicate behavior based on the current state of the filesystem or a particular file on the filesystem is encouraging odd behavior in the face of filesystem race conditions. It's far better to attempt an operation (like loading a file or creating a directory) and handle the error gracefully than it is to try to figure out ahead of time whether the operation will succeed.
      • fileExistsAtPathIsDirectory

        public boolean fileExistsAtPathIsDirectory​(java.lang.String path,
                                                   org.moe.natj.general.ptr.BoolPtr isDirectory)
      • fileSystemAttributesAtPath

        @Deprecated
        public NSDictionary<?,​?> fileSystemAttributesAtPath​(java.lang.String path)
        Deprecated.
      • fileSystemRepresentationWithPath

        public java.lang.String fileSystemRepresentationWithPath​(java.lang.String path)
        fileSystemRepresentationWithPath: returns an array of characters suitable for passing to lower-level POSIX style APIs. The string is provided in the representation most appropriate for the filesystem in question.
      • getRelationshipOfDirectoryInDomainToItemAtURLError

        public boolean getRelationshipOfDirectoryInDomainToItemAtURLError​(org.moe.natj.general.ptr.NIntPtr outRelationship,
                                                                          long directory,
                                                                          long domainMask,
                                                                          NSURL url,
                                                                          org.moe.natj.general.ptr.Ptr<NSError> error)
        Similar to -[NSFileManager getRelationship:ofDirectoryAtURL:toItemAtURL:error:], except that the directory is instead defined by an NSSearchPathDirectory and NSSearchPathDomainMask. Pass 0 for domainMask to instruct the method to automatically choose the domain appropriate for 'url'. For example, to discover if a file is contained by a Trash directory, call [fileManager getRelationship:&result ofDirectory:NSTrashDirectory inDomain:0 toItemAtURL:url error:&error].
      • getRelationshipOfDirectoryAtURLToItemAtURLError

        public boolean getRelationshipOfDirectoryAtURLToItemAtURLError​(org.moe.natj.general.ptr.NIntPtr outRelationship,
                                                                       NSURL directoryURL,
                                                                       NSURL otherURL,
                                                                       org.moe.natj.general.ptr.Ptr<NSError> error)
        Sets 'outRelationship' to NSURLRelationshipContains if the directory at 'directoryURL' directly or indirectly contains the item at 'otherURL', meaning 'directoryURL' is found while enumerating parent URLs starting from 'otherURL'. Sets 'outRelationship' to NSURLRelationshipSame if 'directoryURL' and 'otherURL' locate the same item, meaning they have the same NSURLFileResourceIdentifierKey value. If 'directoryURL' is not a directory, or does not contain 'otherURL' and they do not locate the same file, then sets 'outRelationship' to NSURLRelationshipOther. If an error occurs, returns NO and sets 'error'.
      • isDeletableFileAtPath

        public boolean isDeletableFileAtPath​(java.lang.String path)
      • isExecutableFileAtPath

        public boolean isExecutableFileAtPath​(java.lang.String path)
      • isReadableFileAtPath

        public boolean isReadableFileAtPath​(java.lang.String path)
      • isUbiquitousItemAtURL

        public boolean isUbiquitousItemAtURL​(NSURL url)
        Returns YES if the item for the specified URL is ubiquitous, NO otherwise.
      • isWritableFileAtPath

        public boolean isWritableFileAtPath​(java.lang.String path)
      • linkItemAtPathToPathError

        public boolean linkItemAtPathToPathError​(java.lang.String srcPath,
                                                 java.lang.String dstPath,
                                                 org.moe.natj.general.ptr.Ptr<NSError> error)
      • linkItemAtURLToURLError

        public boolean linkItemAtURLToURLError​(NSURL srcURL,
                                               NSURL dstURL,
                                               org.moe.natj.general.ptr.Ptr<NSError> error)
      • mountedVolumeURLsIncludingResourceValuesForKeysOptions

        public NSArray<? extends NSURL> mountedVolumeURLsIncludingResourceValuesForKeysOptions​(NSArray<java.lang.String> propertyKeys,
                                                                                               long options)
        -mountedVolumeURLsIncludingResourceValuesForKeys:options: returns an NSArray of NSURLs locating the mounted volumes available on the computer. The property keys that can be requested are available in .
      • moveItemAtPathToPathError

        public boolean moveItemAtPathToPathError​(java.lang.String srcPath,
                                                 java.lang.String dstPath,
                                                 org.moe.natj.general.ptr.Ptr<NSError> error)
      • moveItemAtURLToURLError

        public boolean moveItemAtURLToURLError​(NSURL srcURL,
                                               NSURL dstURL,
                                               org.moe.natj.general.ptr.Ptr<NSError> error)
      • pathContentOfSymbolicLinkAtPath

        @Deprecated
        public java.lang.String pathContentOfSymbolicLinkAtPath​(java.lang.String path)
        Deprecated.
      • removeItemAtPathError

        public boolean removeItemAtPathError​(java.lang.String path,
                                             org.moe.natj.general.ptr.Ptr<NSError> error)
      • removeItemAtURLError

        public boolean removeItemAtURLError​(NSURL URL,
                                            org.moe.natj.general.ptr.Ptr<NSError> error)
      • replaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError

        public boolean replaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError​(NSURL originalItemURL,
                                                                                               NSURL newItemURL,
                                                                                               java.lang.String backupItemName,
                                                                                               long options,
                                                                                               org.moe.natj.general.ptr.Ptr<NSURL> resultingURL,
                                                                                               org.moe.natj.general.ptr.Ptr<NSError> error)
        -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: is for developers who wish to perform a safe-save without using the full NSDocument machinery that is available in the AppKit. The `originalItemURL` is the item being replaced. `newItemURL` is the item which will replace the original item. This item should be placed in a temporary directory as provided by the OS, or in a uniquely named directory placed in the same directory as the original item if the temporary directory is not available. If `backupItemName` is provided, that name will be used to create a backup of the original item. The backup is placed in the same directory as the original item. If an error occurs during the creation of the backup item, the operation will fail. If there is already an item with the same name as the backup item, that item will be removed. The backup item will be removed in the event of success unless the `NSFileManagerItemReplacementWithoutDeletingBackupItem` option is provided in `options`. For `options`, pass `0` to get the default behavior, which uses only the metadata from the new item while adjusting some properties using values from the original item. Pass `NSFileManagerItemReplacementUsingNewMetadataOnly` in order to use all possible metadata from the new item.
      • setAttributesOfItemAtPathError

        public boolean setAttributesOfItemAtPathError​(NSDictionary<java.lang.String,​?> attributes,
                                                      java.lang.String path,
                                                      org.moe.natj.general.ptr.Ptr<NSError> error)
        setAttributes:ofItemAtPath:error: returns YES when the attributes specified in the 'attributes' dictionary are set successfully on the item specified by 'path'. If this method returns NO, a presentable NSError will be provided by-reference in the 'error' parameter. If no error is required, you may pass 'nil' for the error. This method replaces changeFileAttributes:atPath:.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(NSFileManagerDelegate value)
        Instances of NSFileManager may now have delegates. Each instance has one delegate, and the delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of an NSFileManager.
      • setDelegate

        public void setDelegate​(NSFileManagerDelegate value)
        Instances of NSFileManager may now have delegates. Each instance has one delegate, and the delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of an NSFileManager.
      • setUbiquitousItemAtURLDestinationURLError

        public boolean setUbiquitousItemAtURLDestinationURLError​(boolean flag,
                                                                 NSURL url,
                                                                 NSURL destinationURL,
                                                                 org.moe.natj.general.ptr.Ptr<NSError> error)
        Changes whether the item for the specified URL is ubiquitous and moves the item to the destination URL. When making an item ubiquitous, the destination URL must be prefixed with a URL from -URLForUbiquityContainerIdentifier:. Returns YES if the change is successful, NO otherwise.
      • startDownloadingUbiquitousItemAtURLError

        public boolean startDownloadingUbiquitousItemAtURLError​(NSURL url,
                                                                org.moe.natj.general.ptr.Ptr<NSError> error)
        Start downloading a local instance of the specified ubiquitous item, if necessary. Returns YES if the download started successfully or wasn't necessary, NO otherwise.
      • stringWithFileSystemRepresentationLength

        public java.lang.String stringWithFileSystemRepresentationLength​(org.moe.natj.general.ptr.ConstBytePtr str,
                                                                         long len)
        stringWithFileSystemRepresentation:length: returns an NSString created from an array of bytes that are in the filesystem representation.
      • subpathsAtPath

        public NSArray<java.lang.String> subpathsAtPath​(java.lang.String path)
        subpathsAtPath: returns an NSArray of all contents and subpaths recursively from the provided path. This may be very expensive to compute for deep filesystem hierarchies, and should probably be avoided.
      • subpathsOfDirectoryAtPathError

        public NSArray<java.lang.String> subpathsOfDirectoryAtPathError​(java.lang.String path,
                                                                        org.moe.natj.general.ptr.Ptr<NSError> error)
        subpathsOfDirectoryAtPath:error: returns an NSArray of NSStrings representing the filenames of the items in the specified directory and all its subdirectories recursively. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. If the directory contains no items, this method will return the empty array. This method replaces subpathsAtPath:
      • temporaryDirectory

        public NSURL temporaryDirectory()
      • ubiquityIdentityToken

        public java.lang.Object ubiquityIdentityToken()
        Returns an opaque token that represents the current ubiquity identity. This object can be copied, encoded, or compared with isEqual:. When ubiquity containers are unavailable because the user has disabled them, or when the user is simply not logged in, this method will return nil. The NSUbiquityIdentityDidChangeNotification notification is posted after this value changes. If you don't need the container URL and just want to check if ubiquity containers are available you should use this method instead of checking -URLForUbiquityContainerIdentifier:.
      • getFileProviderServicesForItemAtURLCompletionHandler

        public void getFileProviderServicesForItemAtURLCompletionHandler​(NSURL url,
                                                                         NSFileManager.Block_getFileProviderServicesForItemAtURLCompletionHandler completionHandler)
        Asynchronously returns a dictionary of zero or more NSFileProviderService instances, which enable your application to instruct the file's provider to take various actions on or with regards to the given URL. To do this, first identify an NSFileProviderService object whose name matches the service you wish to use. Then get an NSXPCConnection from it and set up its NSXPCInterface with the protocol that matches the service's name. You'll need to refer to external documentation or an SDK supplied by the provider to get this information. Once an NSXPCConnection is obtained, you must finish configuring it and send it -resume. Failure to do so will result in leaking system resources.
      • trashItemAtURLResultingItemURLError

        public boolean trashItemAtURLResultingItemURLError​(NSURL url,
                                                           org.moe.natj.general.ptr.Ptr<NSURL> outResultingURL,
                                                           org.moe.natj.general.ptr.Ptr<NSError> error)
        trashItemAtURL:resultingItemURL:error: returns YES if the item at 'url' was successfully moved to a Trash. Since the operation may require renaming the file to avoid collisions, it also returns by reference the resulting URL that the item was moved to. If this method returns NO, the item was not moved and an NSError will be returned by reference in the 'error' parameter. To easily discover if an item is in the Trash, you may use [fileManager getRelationship:&result ofDirectory:NSTrashDirectory inDomain:0 toItemAtURL:url error:&error] && result == NSURLRelationshipContains.