Namespace: Consultingwerk.Util
Class 
NetworkHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:NetworkHelper
Purpose:Provides access to .NET network routines
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Sun Sep 23 09:49:17 CEST 2012
Notes:Supports custom log file messages using the "NetworkHelper" custom message sub system
Purpose: Disallow instance creation
Notes:



Top Method Summary
Options Name Purpose
+ DownloadFile (character, character) Downloads a file from a specified web address to a given file
+ LONGCHAR DownloadString (character) Downloads a string from a specified web address to a given file
+ LONGCHAR DownloadString (character, HttpStatus) Downloads a string from a specified web address to a given file
# LOGICAL EmailCheckDotAtom (character) Validates that a DotAtom of an EmailAddress consists of valid characters only.
# LOGICAL EmailSplitParts (character, character, character) Splits an EmailAddress into Local Part and Domain
# LOGICAL EmailVerifyDomain (character, logical) Verifies a Domain Name on character base and if wanted by checking the domains MX record
# LOGICAL EmailVerifyLocalPart (character) Verifies a LocalPart on character base
+ CHARACTER HostFromUrl (character) Extracts the Host portion from an URL
+ CHARACTER ResourceFromUrl (character) Extracts the Resource portion from an http or https URL
+ LOGICAL ValidateEmailAddress (character) Validates an Email Address by splitting it into Domain and Local Part.
+ LOGICAL ValidateEmailAddress (character, logical) Validates an Email Address by splitting it into Domain and Local Part.
# LOGICAL VerifyMXRecord (character) Verifies the Domain by checking the existance of the MX record

Top Constructor Summary
Options Name Purpose
# NetworkHelper () Disallow instance creation


Method Detail
Top

PUBLIC DownloadFile (character, character)

Purpose: Downloads a file from a specified web address to a given file
Notes: Currently supported on Windows only

Parameters:
pcFileAddress CHARACTER
The address (URL) to download from
pcTargetFile CHARACTER
The file name (and path) to download to
Top

PUBLIC LONGCHAR DownloadString (character)

Purpose: Downloads a string from a specified web address to a given file
Notes: Currently supported on Windows only

Parameters:
pcFileAddress CHARACTER
The address (URL) to download from
Returns LONGCHAR
A LONGCHAR value with the data from the URL
Top

PUBLIC LONGCHAR DownloadString (character, HttpStatus)

Purpose: Downloads a string from a specified web address to a given file
Notes: Currently supported on Windows only, not supported on OpenEdge 10.2B
due to .NET 4.0 dependency

Parameters:
pcFileAddress CHARACTER
The address (URL) to download from
poStatus Consultingwerk.Util.HttpStatus
The HttpStatus instance with the http status code and description of the request
Returns LONGCHAR
A LONGCHAR value with the data from the URL
Top

PROTECTED LOGICAL EmailCheckDotAtom (character)

Purpose: Validates that a DotAtom of an EmailAddress consists of valid
characters only.
Notes: Normals charset (always allowed):
A-Za-z0-9.!#$%&'*+-/=?^_`{|}~
Extended charset (only when enclosed by double quotes):
"(),:[>@[\] [>@[\] plus space

Parameters:
pcAtom CHARACTER
Dot Atom of the email address to be verified
Returns LOGICAL
Returns TRUE if the validation was successful
Top

PROTECTED LOGICAL EmailSplitParts (character, character, character)

Purpose: Splits an EmailAddress into Local Part and Domain
Notes: Checks if there are at least two @ seperated portions and
splits at the last occurance of the @ sign as they are allowed
inside quotes in the Local Part.

Parameters:
pcEmailAddress CHARACTER
Full EmailAddress to be verified
pcLocalPart CHARACTER
Local part of the email address (everything before @domain.xyz)
pcDomain CHARACTER
Domain part of the email address (everything after the last @)
Returns LOGICAL
Returns TRUE if the structure validation was successful
Top

PROTECTED LOGICAL EmailVerifyDomain (character, logical)

Purpose: Verifies a Domain Name on character base and if wanted
by checking the domains MX record
Notes:

Parameters:
pcDomain CHARACTER
Domain part of the email address (everything after the last @)
plVerifyMX LOGICAL
Optional verify the MX for the given Domain
Returns LOGICAL
Returns TRUE if the validation was successful
Top

PROTECTED LOGICAL EmailVerifyLocalPart (character)

Purpose: Verifies a LocalPart on character base
Notes:

Parameters:
pcLocalPart CHARACTER
Local part of the email address (everything before @domain.xyz)
Returns LOGICAL
Returns TRUE if the validation was successful
Top

PUBLIC CHARACTER HostFromUrl (character)

Purpose: Extracts the Host portion from an URL
Notes:

Parameters:
pcUrl CHARACTER
The URL that contains the host
Returns CHARACTER
The hostname
Top

PUBLIC CHARACTER ResourceFromUrl (character)

Purpose: Extracts the Resource portion from an http or https URL
Notes:

Parameters:
pcUrl CHARACTER
The URL that contains the resource
Returns CHARACTER
The resource name
Top

PUBLIC LOGICAL ValidateEmailAddress (character)

Purpose: Validates an Email Address by splitting it into Domain and Local Part.
Notes:

Parameters:
pcEmailAddress CHARACTER
Full EmailAddress to be verified
Returns LOGICAL
Returns TRUE if the validation was successful
Top

PUBLIC LOGICAL ValidateEmailAddress (character, logical)

Purpose: Validates an Email Address by splitting it into Domain and Local Part.
Notes:

Parameters:
pcEmailAddress CHARACTER
Full EmailAddress to be verified
plVerifyMX LOGICAL
Optional verify the MX for the given Domain
Returns LOGICAL
Returns TRUE if the validation was successful
Top

PROTECTED LOGICAL VerifyMXRecord (character)

Purpose: Verifies the Domain by checking the existance of the MX record
Notes: Needs different logic for Windows and Unix

Parameters:
pcDomain CHARACTER
Domain string to lookup as an MX
Returns LOGICAL
Returns TRUE if the MX lookup was successful


Constructor Detail
Top

PROTECTED NetworkHelper ()

Purpose: Disallow instance creation
Notes:



©2006-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       15.04.2024 06:16:57