Twoorb Plugins  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Twoorb.FileSystem.FileService Class Reference

A file service utility for easy handling of files. Can be extended with different services(for example: FTP; AWSS3) More...

Inheritance diagram for Twoorb.FileSystem.FileService:
Twoorb.FileSystem.FileServiceAWSS3 Twoorb.FileSystem.FileServiceFTP

Public Types

enum  EServiceState {
  EServiceState.Idle, EServiceState.Upload, EServiceState.Download, EServiceState.UploadDirectory,
  EServiceState.DownloadDirectory
}
 The different states of the service. More...
 
enum  EOperationStatus {
  EOperationStatus.OpeningConnection, EOperationStatus.Downloading, EOperationStatus.DownloadComplete, EOperationStatus.Uploading,
  EOperationStatus.UploadComplete, EOperationStatus.OperationFailed, EOperationStatus.ClosingConnection
}
 The status of the current operations More...
 

Public Member Functions

virtual void InitializeService (ServiceSettings settings, FileSystemProgressUpdateEventHandler onProgressUpdate)
 Initialize the service More...
 
virtual void RunFileService ()
 Updates the file service More...
 
virtual void UploadFile (string filePath, string fileName, string savePath, string saveName, FileSystemUploadEventHandler resultHandler)
 Uploads a file to the service More...
 
virtual void UploadDirectory (string uploadDirectory, string uploadPath, bool recursive, string searchPattern, FileSystemUploadEventHandler resultHandler)
 Uploads a directory to the service More...
 
virtual void DownloadFile (string filePath, string fileName, string savePath, string saveName, FileSystemDownloadEventHandler resultHandler)
 Download a file from the service More...
 
virtual void DownloadDirectory (string directoryPath, string savePath, bool recursive, string searchPattern, FileSystemDownloadEventHandler resultHandler)
 Download a directory from the service More...
 
virtual void GetDownloadUrl (string filePath, FileSystemGetDownloadUrlEventHandler eventHandler)
 Gets a download url to a specific file on the service More...
 
virtual void GetDownloadUrl (string filePath, FileSystemGetDownloadUrlWithFormEventHandler eventHandler)
 Gets a download url to a specific file on the service More...
 
virtual void ListObjects (string path, FileSystemListObjectsEventHandler resultHandler)
 Lists objects that's in the specified path More...
 

Protected Member Functions

virtual void LoadSettings (ServiceSettings settings)
 Load the settings into the file system More...
 
virtual void IdleEnter ()
 The state callback for when entering idle More...
 
virtual void IdleUpdate ()
 The state callback for updating idle More...
 
virtual void IdleLeave ()
 The state callback for leaving idle More...
 
virtual void UploadEnter ()
 The state callback for entering upload More...
 
virtual void UploadUpdate ()
 The state callback for updating upload More...
 
virtual void UploadLeave ()
 The state callback for leaving upload More...
 
virtual void DownloadEnter ()
 The state callback for entering download More...
 
virtual void DownloadUpdate ()
 The state callback for updating download More...
 
virtual void DownloadLeave ()
 The state callback for leaving download More...
 
virtual void UploadDirectoryEnter ()
 The state callback for entering UploadDirectory More...
 
virtual void UploadDirectoryUpdate ()
 The state callback for updating UploadDirectory More...
 
virtual void UploadDirectoryLeave ()
 The state callback for leaving UploadDirectory More...
 
virtual void DownloadDirectoryEnter ()
 The state callback for entering DownloadDirectory More...
 
virtual void DownloadDirectoryUpdate ()
 The state callback for updating DownloadDirectory More...
 
virtual void DownloadDirectoryLeave ()
 The state callback for leaving DownloadDirectory More...
 
void ActionComplete ()
 Sets the action to be complete and return the service to Idle-state More...
 

Protected Attributes

FileSystemProgressUpdateEventHandler m_progressUpdateEvent = null
 The progress update event handler More...
 

Detailed Description

A file service utility for easy handling of files. Can be extended with different services(for example: FTP; AWSS3)

Member Enumeration Documentation

The status of the current operations

Enumerator
OpeningConnection 

Opening Connection

Downloading 

Downloading

DownloadComplete 

The download is complete

Uploading 

The system is uploading.

UploadComplete 

The upload is complete.

OperationFailed 

The current operation failed

ClosingConnection 

The connection to the service is closing the connection

The different states of the service.

Enumerator
Idle 

The idle state

Upload 

The service is uploading

Download 

The service is downloading

UploadDirectory 

The service is uploading a directory

DownloadDirectory 

The service is downloading a directory

Member Function Documentation

void Twoorb.FileSystem.FileService.ActionComplete ( )
protected

Sets the action to be complete and return the service to Idle-state

virtual void Twoorb.FileSystem.FileService.DownloadDirectory ( string  directoryPath,
string  savePath,
bool  recursive,
string  searchPattern,
FileSystemDownloadEventHandler  resultHandler 
)
virtual

Download a directory from the service

Parameters
directoryPathThe path of the directory to download
savePathThe path of where the directory should be saved
recursive
searchPatternSearch prefix to filter the search for files to download
resultHandlerThe callback returning the success of the operation

Reimplemented in Twoorb.FileSystem.FileServiceFTP, and Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.DownloadDirectoryEnter ( )
protectedvirtual

The state callback for entering DownloadDirectory

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.DownloadDirectoryLeave ( )
protectedvirtual

The state callback for leaving DownloadDirectory

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.DownloadDirectoryUpdate ( )
protectedvirtual

The state callback for updating DownloadDirectory

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.DownloadEnter ( )
protectedvirtual

The state callback for entering download

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.DownloadFile ( string  filePath,
string  fileName,
string  savePath,
string  saveName,
FileSystemDownloadEventHandler  resultHandler 
)
virtual

Download a file from the service

Parameters
filePathThe path to the folder where the file to download resides
fileNameThe name of the file
savePathThe path to the folder where the file should be saved
saveNameTha name of the file to download
resultHandlerThe callback returning the success of the operation

Reimplemented in Twoorb.FileSystem.FileServiceFTP, and Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.DownloadLeave ( )
protectedvirtual

The state callback for leaving download

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.DownloadUpdate ( )
protectedvirtual

The state callback for updating download

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.GetDownloadUrl ( string  filePath,
FileSystemGetDownloadUrlEventHandler  eventHandler 
)
virtual

Gets a download url to a specific file on the service

Parameters
filePathThe path on the fileservice(key) to the file you want the url for
eventHandlerCallback returning the success of the operation along with the url

Reimplemented in Twoorb.FileSystem.FileServiceFTP, and Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.GetDownloadUrl ( string  filePath,
FileSystemGetDownloadUrlWithFormEventHandler  eventHandler 
)
virtual

Gets a download url to a specific file on the service

Parameters
filePathThe path on the fileservice(key) to the file you want the url for
eventHandlerCallback returning the success of the operation along with the url AND a hashtable with headers for authentication(if necessary)

Reimplemented in Twoorb.FileSystem.FileServiceFTP, and Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.IdleEnter ( )
protectedvirtual

The state callback for when entering idle

virtual void Twoorb.FileSystem.FileService.IdleLeave ( )
protectedvirtual

The state callback for leaving idle

virtual void Twoorb.FileSystem.FileService.IdleUpdate ( )
protectedvirtual

The state callback for updating idle

virtual void Twoorb.FileSystem.FileService.InitializeService ( ServiceSettings  settings,
FileSystemProgressUpdateEventHandler  onProgressUpdate 
)
virtual

Initialize the service

Parameters
settingsThe service settings
onProgressUpdateThe progress handler for status updates.

Reimplemented in Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.ListObjects ( string  path,
FileSystemListObjectsEventHandler  resultHandler 
)
virtual

Lists objects that's in the specified path

Parameters
pathThe folder path in which to list objects
resultHandlerThe callback returning the success of the operation along with the list of objects

Reimplemented in Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.LoadSettings ( ServiceSettings  settings)
protectedvirtual

Load the settings into the file system

Parameters
settings

Reimplemented in Twoorb.FileSystem.FileServiceAWSS3, and Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.RunFileService ( )
virtual

Updates the file service

virtual void Twoorb.FileSystem.FileService.UploadDirectory ( string  uploadDirectory,
string  uploadPath,
bool  recursive,
string  searchPattern,
FileSystemUploadEventHandler  resultHandler 
)
virtual

Uploads a directory to the service

Parameters
uploadDirectoryThe directory to upload
uploadPathThe path of where to save the file
recursiveIf subfolders and files should be included
searchPatternSearch prefix is the option to filter the search. If you only want to list objects in a specific folder, you set the folder name here to be added as a prefix to the search
resultHandlerThe callback returning the success of the operation

Reimplemented in Twoorb.FileSystem.FileServiceFTP, and Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.UploadDirectoryEnter ( )
protectedvirtual

The state callback for entering UploadDirectory

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.UploadDirectoryLeave ( )
protectedvirtual

The state callback for leaving UploadDirectory

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.UploadDirectoryUpdate ( )
protectedvirtual

The state callback for updating UploadDirectory

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.UploadEnter ( )
protectedvirtual

The state callback for entering upload

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.UploadFile ( string  filePath,
string  fileName,
string  savePath,
string  saveName,
FileSystemUploadEventHandler  resultHandler 
)
virtual

Uploads a file to the service

Parameters
filePathThe path to the folder where the file to upload resides
fileNameThe name of the file to upload
savePathThe path of where to save the file
saveNameThe name of the file once uploaded
resultHandlerThe callback returning the success of the operation

Reimplemented in Twoorb.FileSystem.FileServiceFTP, and Twoorb.FileSystem.FileServiceAWSS3.

virtual void Twoorb.FileSystem.FileService.UploadLeave ( )
protectedvirtual

The state callback for leaving upload

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

virtual void Twoorb.FileSystem.FileService.UploadUpdate ( )
protectedvirtual

The state callback for updating upload

Reimplemented in Twoorb.FileSystem.FileServiceFTP.

Member Data Documentation

FileSystemProgressUpdateEventHandler Twoorb.FileSystem.FileService.m_progressUpdateEvent = null
protected

The progress update event handler


The documentation for this class was generated from the following file: