Skip to content

Reference

OpcFileInfo Members

Provides a default implementation of the IOpcFileInfo interface representing a FileInfo for the use in OPC UA.

Reference

OpcFileInfo Members ​

Type
OpcFileInfo
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Constructors ​

OpcFileInfo ​

2 overloads

OverloadDescription
OpcFileInfo(string)Initializes a new instance of the OpcFileInfo class with the filePath specified.
OpcFileInfo(FileInfo)Initializes a new instance of the OpcFileInfo class with the FileInfo to use as the underlyingFileInfo.

OpcFileInfo(string) ​

Initializes a new instance of the OpcFileInfo class with the filePath specified.

csharp
public OpcFileInfo(string filePath)
vbnet
Public Sub New(filePath As String)

Parameters

NameTypeDescription
filePathStringThe fully qualified path or the relative path to the file to represent.

OpcFileInfo(FileInfo) ​

Initializes a new instance of the OpcFileInfo class with the FileInfo to use as the underlyingFileInfo.

csharp
public OpcFileInfo(FileInfo underlyingFileInfo)
vbnet
Public Sub New(underlyingFileInfo As FileInfo)

Parameters

NameTypeDescription
underlyingFileInfoFileInfoThe underlying FileInfo to use.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe underlyingFileInfo is a null reference (Nothing in Visual Basic).

Properties ​

Exists ​

Gets a value indicating whether a file exists.

csharp
public bool Exists { get; }
vbnet
Public ReadOnly Property Exists As Boolean

Property value

Boolean

The value true if the file exists; false if the file does not exist.

Implements

Exists

IsReadOnly ​

virtual

Gets or sets a value that determines if the current file is read only.

csharp
public virtual bool IsReadOnly { get; }
vbnet
Public Overridable ReadOnly Property IsReadOnly As Boolean

Property value

Boolean

The value true if the current file is read only; otherwise the value false.

Implements

IsReadOnly

Length ​

Gets the size, in bytes, of the current file.

csharp
public long Length { get; }
vbnet
Public ReadOnly Property Length As Long

Property value

Int64

The size of the current file in bytes.

Implements

Length

UnderlyingFileInfo ​

Gets the underlying FileInfo used by the current OpcFileInfo.

csharp
public FileInfo UnderlyingFileInfo { get; }
vbnet
Public ReadOnly Property UnderlyingFileInfo As FileInfo

Property value

FileInfo

The instance of the FileInfo class used by the current OpcFileInfo.

Methods ​

GetMimeType ​

Determines the internet media type (mime- or content-type) of the file.

csharp
public string GetMimeType()
vbnet
Public Function GetMimeType() As String

Returns

String

The type name according to the specification of multipurpose internet mail extensions (MIME) of the file represented.

Implements

GetMimeType

Open ​

virtual

Opens a file in the specified mode.

csharp
public virtual Stream Open(OpcFileMode mode)
vbnet
Public Overridable Function Open(mode As OpcFileMode) As Stream

Parameters

NameTypeDescription
modeOpcFileModeA OpcFileMode value specifying the mode in which to open the file.

Returns

Stream

A file opened in the specified mode.

Exceptions

ExceptionCondition
ArgumentExceptionThe file mode specified is invalid.

Implements

Open

OpenCore ​

protected · virtual · since v2.17

Opens the underlying file info with the specified mode, access, and share.

csharp
protected virtual Stream OpenCore(
    FileMode fileMode,
    FileAccess fileAccess,
    FileShare fileShare)
vbnet
Protected Overridable Function OpenCore(
    fileMode As FileMode,
    fileAccess As FileAccess,
    fileShare As FileShare) As Stream

Parameters

NameTypeDescription
fileModeFileModeA FileMode constant specifying the mode (for example, Open or Append) in which to open the file.
fileAccessFileAccessA FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access.
fileShareFileShareA FileShare constant specifying the type of access other FileStream objects have to this file.

Returns

Stream

A FileStream object opened with the specified mode, access, and sharing options.

Refresh ​

Refreshes the state of the object.

csharp
public void Refresh()
vbnet
Public Sub Refresh()

Exceptions

ExceptionCondition
IOExceptionA device such as a disk drive is not ready.

Implements

Refresh