C# Class Microsoft.Research.DataOnboarding.RepositoryAdapters.SkyDrive.SkyDriveAdapter

Inheritance: BaseAdapter, IRepositoryAdapter
Mostra file Open project: CDLUC3/dataup2 Class Usage Examples

Public Methods

Method Description
CheckIfFileExists ( string downloadURL, string fileIdentifier, string authorization ) : OperationStatus

Verifies if the file exists in the repository

DownloadFile ( string downloadUrl, string authorization, string fileName ) : Microsoft.Research.DataOnboarding.Utilities.Model.DataFile

Method to download the file from the repository.

RefreshToken ( string refreshToken ) : AuthToken

Retrives the Access token by passing refresh token

SkyDriveAdapter ( ) : Microsoft.Research.DataOnboarding.DomainModel

Initializes a new instance of the SkyDriveAdapter class.

Private Methods

Method Description
CreateFolder ( string folderName, string parentFolderId, AuthToken token ) : string

Creates the folder.

CreateFolderForFile ( string repositoryName, string fileId, string fileName, AuthToken authToken ) : string

The method creates the folder structure to upload the file

DownloadFile ( string fileId, string fileName, string tempFolderPath, AuthToken token ) : OperationStatus

Downloads the file to a temp location

DownloadFile ( string fileId, AuthToken token ) : byte[]

Downloads the file and returns the byte array

GetChildFolders ( string parentFolderId, AuthToken token ) : Structure

Returns the list of child folder.

GetFolder ( string folderName, string parentFolderId, AuthToken token ) : string

Returns the Folder Id.

GetIdentifier ( MerritQueryData queryData, RepositoryModel repositoryModel ) : string
GetOrCreateFolder ( string folderName, string parentFolderId, AuthToken authToken ) : string

Checks if the folder exists and if not then creates

GetRootFolder ( AuthToken token ) : string

Gets the Root Folder.

PostFile ( PublishFileModel publishFileModel ) : OperationStatus
UploadFile ( Microsoft.Research.DataOnboarding.Utilities.Model.PublishSkyDriveFileModel publishSkyDriveFileModel ) : string

uploads the file to skydrive

Method Details

CheckIfFileExists() public method

Verifies if the file exists in the repository
public CheckIfFileExists ( string downloadURL, string fileIdentifier, string authorization ) : OperationStatus
downloadURL string
fileIdentifier string File Identifier
authorization string AccessToken in case of skydrive and username password for Merrit
return Microsoft.Research.DataOnboarding.Utilities.OperationStatus

DownloadFile() public method

Method to download the file from the repository.
public DownloadFile ( string downloadUrl, string authorization, string fileName ) : Microsoft.Research.DataOnboarding.Utilities.Model.DataFile
downloadUrl string
authorization string
fileName string
return Microsoft.Research.DataOnboarding.Utilities.Model.DataFile

RefreshToken() public method

Retrives the Access token by passing refresh token
public RefreshToken ( string refreshToken ) : AuthToken
refreshToken string refresh Token
return Microsoft.Research.DataOnboarding.DomainModel.AuthToken

SkyDriveAdapter() public method

Initializes a new instance of the SkyDriveAdapter class.
public SkyDriveAdapter ( ) : Microsoft.Research.DataOnboarding.DomainModel
return Microsoft.Research.DataOnboarding.DomainModel