Files
RestKit/Code/Support/RKDirectory.h
Blake Watters 59eec38f6e Updated RKDirectory with method for ensuring existence of directories. RKTestEnvironment
now ensures the Caches and Application Data directories exist at test initialization.
Enables test suite to run from command line or with a CI environment. refs #293
2012-04-03 23:39:43 -04:00

46 lines
1.4 KiB
Objective-C

//
// RKDirectory.h
// RestKit
//
// Created by Blake Watters on 12/9/11.
// Copyright (c) 2011 RestKit. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
iOS and OS X agnostic accessors for safely returning directory paths for use
by the framework and applications.
*/
@interface RKDirectory : NSObject
/**
Returns the path to the Application Data directory for the executing application. On iOS,
this is a sandboxed path specific for the executing application. On OS X, this is an application
specific path under NSApplicationSupportDirectory (i.e. ~/Application Support).
@return The full path to the application data directory.
*/
+ (NSString *)applicationDataDirectory;
/**
Returns a path to the root caches directory used by RestKit for storage. On iOS, this is
a sanboxed path specific for the executing application. On OS X, this is an application
specific path under NSCachesDirectory (i.e. ~/Library/Caches).
@return The full path to the Caches directory.
*/
+ (NSString *)cachesDirectory;
/**
Ensures that a directory exists at a given path by checking for the existence
of the directory and creating it if it does not exist.
@param path The path to ensure a directory exists at.
@param error On input, a pointer to an error object.
@returns A Boolean value indicating if the directory exists.
*/
+ (BOOL)ensureDirectoryExistsAtPath:(NSString *)path error:(NSError **)error;
@end