Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vipera-npm-registry / com.vipera.de.foundation.foo   js

Repository URL to install this package:

Version: 1.0.1 

/ src / ios / DECommons.framework / Headers / FileUtility.h

//
//  FileUtility.h
//  DynamicEngine
//
//  Created by Mobile3D on 03/12/13.
//  Copyright (c) 2013 Mobile3D. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface FileUtility : NSObject

/**
 *  This method checks if a file exists at the passed path.
 *
 *  @param path the path to check.
 *  @return A boolean indicating if the file exists.
 */
+ (BOOL) existsFileAtPath:(NSString *) path;

/**
 *  This method is used to get all the subpaths of a directory.
 *
 *  @param directoryPath The path to enumerate.
 *  @param outError A pointer to an NSError. Used to return an error if it was generated.
 *  @return An array of paths. It will be an empty array if the folder has no subpaths. Nil only if there was an error.
 */
+ (NSArray *) subpathsOfDirectoryAtPath:(NSString *) directoryPath error:(NSError *__autoreleasing*) outError;

/**
 *  Method that returns the size in bytes of the element at the passed path.
 *
 *  @param path The path of the element.
 *  @param outError A pointer to an NSError. Used to return an error if it was generated.
 *  @return A long long containing the size of the element at path in bytes.
 */
+ (UInt64)sizeOfElementAtPath:(NSString *)path error:(NSError *__autoreleasing *)outError;

/**
 *  Method that returns the free space in the filesystem.
 *
 *  @param outError A pointer to an NSError. Used to return an error if it was generated.
 *  @return A long long containing the free space in bytes.
 */
+ (UInt64)freeSpaceError:(NSError *__autoreleasing *)outError;

/**
 *  Method that tries to copy the assets in the documents directory where they can be updated.
 *  Also checks if the assets are already in place, if so return immediately.
 *
 *  @param  source The path of the source folder to copy.
 *  @param  destination The path for the destiantion folder of the copy.
 *  @param error A pointer where to put an error if there is one.
 *  @return A boolean indicating if the assets have been copied or not.
 */
+ (BOOL)copyItemFromPath:(NSString *)source toPath:(NSString *)destination error:(NSError __autoreleasing**) outError;

/**
 * This method is used to exclude an item from the device backup.
 *
 *  @param itemPath The path for the item to exclude.
 *  @param error A pointer where to put an error if there is one.
 *  @return A boolean indicating if the operation was succesful.
 */
+ (BOOL) excludeFromBackupItemAtPath:(NSString *)itemPath error:(NSError __autoreleasing**) outError;

/**
 *  Method that tries to delete the assets from the document folder.
 *
 *  @param  path The path of the folder to be deleted.
 *  @param outError A pointer to an NSError. Used to return an error if it was generated.
 *  @return A boolean indicating the success of the operation or not.
 */
+ (BOOL)deleteItemAtPath:(NSString *)path withError:(NSError *__autoreleasing *)outError;

/**
 *  Method that tries to move the assets from a source to a destination folder.
 *  Also checks if the assets are already in place, if so return immediately.
 *
 *  @param  source The path of the source folder to move.
 *  @param  destination The path for the destiantion folder of the move.
 *  @param error A pointer where to put an error if there is one.
 *  @return A boolean indicating if the assets have been moved or not.
 */
+ (BOOL)moveItemFromPath:(NSString *)source toPath:(NSString *)destination error:(NSError __autoreleasing**) outError;

/**
 * This method is used to create a new directory.
 *
 *  @param directoryPath    The path for the directory to be created.
 *  @param error A pointer where to put an error if there is one.
 *  @return A boolean indicating if the directory was created or not.
 */
+ (BOOL) createNewDirectory:(NSString *) directoryPath error:(NSError __autoreleasing**) outError;

/**
 *  Returns the documents directory path.
 *
 *  @return The documents directory path.
 */
+ (NSString *) documentsDirectoryPath;

/**
 *  Returns the documents directory url.
 *
 *  @return the documents directory url.
 */
+ (NSURL *) documentsDirectoryURL;

/**
 *  Builds an url froma a file name and a base url.
 *
 *  @param fileName the file name.
 *  @param baseURL  The base url.
 *
 *  @return An url composed with base name + file name.
 */
+ (NSURL *)urlForFile:(NSString *)fileName withBaseURL:(NSURL *)baseURL;

@end