Class CFURL

All Implemented Interfaces:
AutoCloseable

public class CFURL
extends CFType
  • Constructor Details

    • CFURL

      protected CFURL()
  • Method Details

    • getClassTypeID

      public static long getClassTypeID()
    • asData

      public static CFData asData​(CFAllocator allocator, CFURL url, CFStringEncodings encoding, boolean escapeWhitespace)
    • create

      public static CFURL create​(CFAllocator allocator, String URLString, CFURL baseURL)
    • createWithFileSystemPath

      public static CFURL createWithFileSystemPath​(CFAllocator allocator, String filePath, CFURLPathStyle pathStyle, boolean isDirectory)
    • createFromFileSystemRepresentation

      public static CFURL createFromFileSystemRepresentation​(CFAllocator allocator, BytePtr buffer, long bufLen, boolean isDirectory)
    • createWithFileSystemPathRelativeToBase

      public static CFURL createWithFileSystemPathRelativeToBase​(CFAllocator allocator, String filePath, CFURLPathStyle pathStyle, boolean isDirectory, CFURL baseURL)
    • createFromFileSystemRepresentationRelativeToBase

      public static CFURL createFromFileSystemRepresentationRelativeToBase​(CFAllocator allocator, BytePtr buffer, long bufLen, boolean isDirectory, CFURL baseURL)
    • getAbsoluteURL

      public CFURL getAbsoluteURL()
    • getString

      public String getString()
    • getBaseURL

      public CFURL getBaseURL()
    • canBeDecomposed

      public boolean canBeDecomposed()
    • getScheme

      public String getScheme()
    • getNetLocation

      public String getNetLocation()
    • getPath

      public String getPath()
    • getStrictPath

      public String getStrictPath​(BooleanPtr isAbsolute)
    • getFileSystemPath

      public String getFileSystemPath​(CFURLPathStyle pathStyle)
    • hasDirectoryPath

      public boolean hasDirectoryPath()
    • getResourceSpecifier

      public String getResourceSpecifier()
    • getHostName

      public String getHostName()
    • getPortNumber

      public int getPortNumber()
    • getUserName

      public String getUserName()
    • getPassword

      public String getPassword()
    • getParameterString

      @Deprecated public String getParameterString​(String charactersToLeaveEscaped)
      Deprecated.
      Deprecated in iOS 13.0. The CFURLCopyParameterString function is deprecated. Post deprecation for applications linked with or after the macOS 10.15, and for all iOS, watchOS, and tvOS applications, CFURLCopyParameterString will always return NULL, and the CFURLCopyPath(), CFURLCopyStrictPath(), and CFURLCopyFileSystemPath() functions will return the complete path including the semicolon separator and params component if the URL string contains them.
    • getQueryString

      public String getQueryString​(String charactersToLeaveEscaped)
    • getFragment

      public String getFragment​(String charactersToLeaveEscaped)
    • getLastPathComponent

      public String getLastPathComponent()
    • getPathExtension

      public String getPathExtension()
    • createCopyByAppendingPathComponent

      public static CFURL createCopyByAppendingPathComponent​(CFAllocator allocator, CFURL url, String pathComponent, boolean isDirectory)
    • createCopyByDeletingLastPathComponent

      public static CFURL createCopyByDeletingLastPathComponent​(CFAllocator allocator, CFURL url)
    • createCopyByAppendingPathExtension

      public static CFURL createCopyByAppendingPathExtension​(CFAllocator allocator, CFURL url, String extension)
    • createCopyByDeletingPathExtension

      public static CFURL createCopyByDeletingPathExtension​(CFAllocator allocator, CFURL url)
    • decodeURLString

      public static String decodeURLString​(CFAllocator allocator, String originalString, String charactersToLeaveEscaped)
    • decodeURLString

      @Deprecated public static String decodeURLString​(CFAllocator allocator, String origString, String charsToLeaveEscaped, CFStringEncodings encoding)
      Deprecated.
      Deprecated in iOS 9.0. Use [NSString stringByRemovingPercentEncoding] or CFURLCreateStringByReplacingPercentEscapes() instead, which always uses the recommended UTF-8 encoding.
    • encodeURLString

      @Deprecated public static String encodeURLString​(CFAllocator allocator, String originalString, String charactersToLeaveUnescaped, String legalURLCharactersToBeEscaped, CFStringEncodings encoding)
      Deprecated.
      Deprecated in iOS 9.0. Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:] instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent (since each URL component or subcomponent has different rules for what characters are valid).
    • isFileReferenceURL

      public boolean isFileReferenceURL()
    • createFileReferenceURL

      public static CFURL createFileReferenceURL​(CFAllocator allocator, CFURL url) throws NSErrorException
      Throws:
      NSErrorException
    • createFilePathURL

      public static CFURL createFilePathURL​(CFAllocator allocator, CFURL url) throws NSErrorException
      Throws:
      NSErrorException
    • getResourceValue

      public boolean getResourceValue​(String key, VoidPtr propertyValueTypeRefPtr) throws NSErrorException
      Throws:
      NSErrorException
    • getResourceValues

      public CFDictionary getResourceValues​(CFArray keys) throws NSErrorException
      Throws:
      NSErrorException
    • setResourceValue

      public boolean setResourceValue​(String key, CFType propertyValue) throws NSErrorException
      Throws:
      NSErrorException
    • setResourceValues

      public boolean setResourceValues​(CFDictionary keyedPropertyValues) throws NSErrorException
      Throws:
      NSErrorException
    • clearResourcePropertyCacheForKey

      public void clearResourcePropertyCacheForKey​(String key)
    • clearResourcePropertyCache

      public void clearResourcePropertyCache()
    • isResourceReachable

      public boolean isResourceReachable() throws NSErrorException
      Throws:
      NSErrorException
    • startAccessingSecurityScopedResource

      public boolean startAccessingSecurityScopedResource()
    • stopAccessingSecurityScopedResource

      public void stopAccessingSecurityScopedResource()
    • getHomeDirectoryURL

      public static CFURL getHomeDirectoryURL()