Erlang -- CosFileTransfer_­FileTransferSession

User's Guide
Reference Manual
Release Notes
PDF
Top

cosFileTransfer
Reference Manual
Version 1.1.10

Expand All
Contract All

Table of Contents

- cosFileTransferApp
  - Top of manual page
  - install/0
  - uninstall/0
  - start/0
  - stop/0
  - create_VFS/4
  - ssl_server_certfile/0
  - ssl_client_certfile/0
  - ssl_server_verify/0
  - ssl_client_verify/0
  - ssl_server_depth/0
  - ssl_client_depth/0
- CosFileTransfer_File
  - Top of manual page
  - '_get_name'/1
  - '_get_complete_file_name'/1
  - '_get_parent'/1
  - '_get_associated_session'/1
- CosFileTransfer_Directory
  - Top of manual page
  - list/2
- CosFileTransfer_FileIterator
  - Top of manual page
  - next_one/1
  - next_n/2
  - destroy/1
- CosFileTransfer_VirtualFileSystem
  - Top of manual page
  - '_get_file_system_type'/1
  - '_get_supported_content_types'/1
  - login/4
- CosFileTransfer_FileTransferSession
  - Top of manual page
  - '_get_protocols_supported'/1
  - set_directory/2
  - create_file/2
  - create_directory/2
  - get_file/2
  - delete/2
  - transfer/3
  - append/3
  - insert/4
  - logout/1

# CosFileTransfer_FileTransferSession

### MODULE

CosFileTransfer_FileTransferSession

### MODULE SUMMARY

This module implements the OMG CosFileTransfer::FileTransferSession interface.

### DESCRIPTION

To get access to the record definitions for the structures use:
-include_lib("cosFileTransfer/include/*.hrl").

### EXPORTS

'_get_protocols_supported'(FTS) -> Return

Types:

FTS = #objref
Return = [#'CosFileTransfer_ProtocolSupport'{protocol_name=Type, addresses=[Address]}]
Type = Address = string()

This read only attribute returns the protocols supported by the target object.

set_directory(FTS, Directory) -> Return

Types:

FTS = Directory = #objref
Return = ok | {'EXCEPTION, E}

Invoking this operation will change the current working directory of the target object's associated file system. If fail to do so the appropriate exception is raised.

create_file(FTS, FileNameList) -> Return

Types:

FTS = #objref
FileNameList = [string()]
Return = File | {'EXCEPTION, E}
File = #objref

This operation creates a File Object representing a file which may or may not exist. For this operation to be independent of the working directory the supplied FileNameList must represent the absolute name.

create_directory(FTS, FileNameList) -> Return

Types:

FTS = #objref
FileNameList = [string()]
Return = Directory | {'EXCEPTION, E}
Directory = #objref

This operation creates a new directory in the target objects associated file systems domain. If fail to do so an exception is raised but, if successful, a Directory object representing the new directory is returned.

get_file(FTS, FileNameList) -> Return

Types:

FTS = #objref
FileNameList = [string()]
Return = FileWrapper | {'EXCEPTION, E}
FileWrapper = #'CosFileTransfer_FileWrapper'{the_file = File file_type = Type}
File = #objref
Type = nfile | ndirectory

This operation, creates a FileWrapper which represents a file or directory, and should be independent of the working Directory, i.e., a full path name must be supplied. Furthermore, the file or directory represented by the FileNameList must exist.

delete(FTS, File) -> Return

Types:

FTS = File = #objref
Return = ok | {'EXCEPTION', E}

This operation removes the file or directory, represented by the File object, from the target objects associated file system. If it is a non-empty directory or non-existing file or directory an exception is raised.

transfer(FTS, SourceFile, DestinationFile) -> Return

Types:

FTS = SourceFile = DestinationFile = #objref
Return = ok | {'EXCEPTION', E}

If the target object's and the DestinationFile's associated FileTransferSession's support the same protocol(s) this operation will copy the file represented by the SourceFile from the target object's file system to a file in the destination FileTransferSession's file system. The file is represented by the DestinationFile object and may not exist. This operation must be invoked on the FileTransferSession associated with the SourceFile object.

append(FTS, SourceFile, DestinationFile) -> Return

Types:

FTS = SourceFile = DestinationFile = #objref
Return = ok | {'EXCEPTION', E}

This operation behaves almost like the transfer/3 operation. The difference is that the DestinationFile must exist since the SourceFile will be appended to the DestinationFile.

Currently, it is not possible to use this operation when the target object represents FTP.

insert(FTS, SourceFile, DestinationFile, Offset) -> Return

Types:

FTS = SourceFile = DestinationFile = #objref
Offset = long()
Return = ok | {'EXCEPTION', E}

This operation behaves almost like the append/3 operation. The difference is that the SourceFile will be inserted into the DestinationFileOffset bytes from the start of the file.

Currently, it is not possible to use this operation when the target object represents FTP.

logout(FTS) -> ok

Types:

FTS = #objref

This operation terminates the target object and closes the connection to the file system it represents.