/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
*/
#import "FRADatabaseConfiguration.h"
#import "FRAError.h"
/*!
* Limited configuration at the moment for the SQLite database.
*
* Uses the iOS file system to locate the default storage location for the
* SQLite database.
*/
/*!
* Specifically uses the <Library folder>/Database/database.sqlite location for
* storage of non-user data which is expected to be backed up by iTunes.
*/
return nil;
}
// Create folder if needed.
return nil;
}
// Create the Database/database.sql file path
}
// Creating the folder if required
return [manager createDirectoryAtPath:folder withIntermediateDirectories:YES attributes:nil error:error];
}
return YES;
}
/*!
* The operating system path that is recommended for storage of files that the user
* should not have direct access to.
*
* @see table 1_1 for more details:
* https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1
*
* @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
* @return nil if the system folder could not be located, otherwise the path of the folder.
*/
NSArray<NSURL*> *possibleURLs = [manager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask];
// Guaranteed to be present by OS
if (error) {
*error = [FRAError createErrorForFilePath:@"NSLibraryDirectory" reason:@"Could not locate system folder /Library"];
}
return nil;
}
}
@end