/** * Creates a file with the specified name. * * @param descriptor File descriptor of file or folder used for operation. * @param callback Result of the operation. * @since v2.0 */ public void Create(FileDescriptor descriptor, IFileResultCallback callback) { // Start logging elapsed time. long tIn = TimerUtil.CurrentTimeMillis(); ILogging logger = AppRegistryBridge.GetInstance().GetLoggingBridge(); if (logger != null) { logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "FileBridge executing create..."); } if (this._delegate != null) { this._delegate.Create(descriptor, callback); if (logger != null) { logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "FileBridge executed 'create' in " + (TimerUtil.CurrentTimeMillis() - tIn) + "ms."); } } else { if (logger != null) { logger.Log(ILoggingLogLevel.Error, this.apiGroup.ToString(), "FileBridge no delegate for 'create'."); } } }
/** * Moves the current file to the given file destination, optionally overwriting and creating the path to the * new destination file. * * @param source File descriptor of file or folder used for operation as source. * @param destination File descriptor of file or folder used for operation as destination. * @param createPath True to create the path if it does not already exist. * @param callback Result of the operation. * @param overwrite True to create the path if it does not already exist. * @since v2.0 */ public void Move(FileDescriptor source, FileDescriptor destination, bool createPath, bool overwrite, IFileResultCallback callback) { // Start logging elapsed time. long tIn = TimerUtil.CurrentTimeMillis(); ILogging logger = AppRegistryBridge.GetInstance().GetLoggingBridge(); if (logger != null) { logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "FileBridge executing move..."); } if (this._delegate != null) { this._delegate.Move(source, destination, createPath, overwrite, callback); if (logger != null) { logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "FileBridge executed 'move' in " + (TimerUtil.CurrentTimeMillis() - tIn) + "ms."); } } else { if (logger != null) { logger.Log(ILoggingLogLevel.Error, this.apiGroup.ToString(), "FileBridge no delegate for 'move'."); } } }