- Inherits from:
- NSObject
- Package:
- com.apple.yellow.foundation
Description forthcoming.
The following constants are provided by NSPathUtilities:
Constant | Type | Description |
AdminApplicationDirectory |
int | 4 |
AllApplicationsDirectory |
int | 100 |
AllDomainsMask |
int | 65535 |
AllLibrariesDirectory |
int | 101 |
ApplicationDirectory |
int | 1 |
DemoApplicationDirectory |
int | 2 |
DeveloperApplicationDirectory |
int | 3 |
DeveloperDirectory |
int | 6 |
DocumentationDirectory |
int | 8 |
LibraryDirectory |
int | 5 |
LocalDomainMask |
int | 2 |
NetworkDomainMask |
int | 4 |
SystemDomainMask |
int | 8 |
UserDirectory |
int | 7 |
UserDomainMask |
int | 1 |
- Constructors
- NSPathUtilities
- TBD_Functional_Method_Group
- URLWithPath
- fileAttributes
- isAbsolutePath
- lastPathComponent
- pathComponents
- pathExtension
- pathFromURL
- pathWithComponents
- pathsMatchingExtensions
- searchPathForDirectoriesInDomains
- setFileAttributes
- stringByAbbreviatingWithTildeInPath
- stringByAppendingPathComponent
- stringByAppendingPathExtension
- stringByDeletingLastPathComponent
- stringByDeletingPathExtension
- stringByExpandingTildeInPath
- stringByResolvingSymlinksInPath
- stringByStandardizingPath
- stringsByAppendingPaths
- temporaryDirectory
public NSPathUtilities()
public static java.net.URL URLWithPath(String aString)
public static NSDictionary fileAttributes(
String aString,
boolean aBoolean)
public static boolean isAbsolutePath(String aString)
public static String lastPathComponent(String aString)
aString's Value | String Returned |
"/tmp/scratch.tiff " |
"scratch.tiff " |
"/tmp/scratch " |
"scratch " |
"/tmp/ " |
"tmp " |
"scratch " |
"scratch " |
"/ " |
"" (an empty string) |
public static NSArray pathComponents(String aString)
If aString begins
with a slash-for example, "/tmp/scratch
"-the
array has these contents:
Index | Path Component |
0 | "/ " |
1 | "tmp " |
2 | "scratch " |
If aString has no separators-for
example, "scratch
"-the
array contains aString itself, in
this case "scratch
".
See Also: pathWithComponents, stringByStandardizingPath
public static String pathExtension(String aString)
aString's Value | String Returned |
"/tmp/scratch.tiff " |
"tiff " |
"/tmp/scratch " |
"" (an empty string) |
"/tmp/ " |
"" (an empty string) |
"/tmp/scratch..tiff " |
"tiff " |
public static String pathFromURL(java.net.URL anURL)
public static String pathWithComponents(NSArray components)
/
"
as the first component. To include a trailing path divider, use
an empty string as the last component. This method doesn't clean
up the path created; use stringByStandardizingPath to
resolve empty components, references to the parent directory, and
so on.See Also: pathComponents
public static NSArray pathsMatchingExtensions(
NSArray anArray1,
NSArray anArray2)
public static NSArray searchPathForDirectoriesInDomains(
int anInt1,
int anInt2,
boolean aBoolean)
public static boolean setFileAttributes(
String aString,
NSDictionary aDictionary)
public static String stringByAbbreviatingWithTildeInPath(String aString)
~
",
substituted for the full path to the current user's home directory,
or "~user
" for a
user other than the current user. Returns aString unaltered
if it doesn't begin with the user's home directory.See Also: stringByExpandingTildeInPath
public static String stringByAppendingPathComponent(
String aString1,
String aString2)
scratch.tiff
":aString's Value | Resulting String |
"/tmp " |
"/tmp/scratch.tiff " |
"/tmp/ " |
"/tmp/scratch.tiff " |
"/ " |
"/scratch.tiff " |
"" (an empty string) | "scratch.tiff " |
See Also: stringsByAppendingPaths, stringByAppendingPathExtension, stringByDeletingLastPathComponent
public static String stringByAppendingPathExtension(
String aString1,
String aString2)
"tiff"
:aString's Value | Resulting String |
"/tmp/scratch.old " |
"/tmp/scratch.old.tiff " |
"/tmp/scratch. " |
"/tmp/scratch..tiff " |
"/tmp/ " |
"/tmp/.tiff " |
"scratch " |
"scratch.tiff " |
See Also: stringByAppendingPathComponent, stringByDeletingPathExtension
public static String stringByDeletingLastPathComponent(String aString)
aString's Value | Resulting String |
"/tmp/scratch.tiff " |
"/tmp " |
"/tmp/lock/ " |
"/tmp " |
"/tmp/ " |
"/ " |
"/tmp " |
"/ " |
"/ " |
"/ " |
"scratch.tiff " |
"" (an empty string) |
See Also: stringByDeletingPathExtension, stringByAppendingPathComponent
public static String stringByDeletingPathExtension(String aString)
aString's Value | Resulting String |
"/tmp/scratch.tiff " |
"/tmp/scratch " |
"/tmp/ " |
"/tmp " |
"scratch.bundle/ " |
"scratch " |
"scratch..tiff " |
"scratch. " |
".tiff " |
"" (an empty string) |
"/ " |
"/ " |
See Also: pathExtension, stringByDeletingLastPathComponent
public static String stringByExpandingTildeInPath(String aString)
~
"
or "~user
", to its
full path value. Returns aString unaltered
if that component can't be expanded.See Also: stringByAbbreviatingWithTildeInPath
public static String stringByResolvingSymlinksInPath(String aString)
public static String stringByStandardizingPath(String aString)
This method can make the following changes in the provided string:
/private
"
from the path if the result still indicates an existing file or
directory (checked by consulting the file system).See Also: stringByExpandingTildeInPath, stringByResolvingSymlinksInPath
public static NSArray stringsByAppendingPaths(
String aString,
NSArray paths)
public static String temporaryDirectory()