mn8 Language Reference | Index    

FTPHandler

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

This concept is working with FTP files. With this concept you can get or set FTP file content.

URL format is : ftp://<userName>:<passwd>@<hostName>/<path>

Possible options :

If user and pwd options are specified then the userName and the passwd will be overwrited in the URL.

Usage

Get the content of specified FTP file.

            $file from  "ftp://userName:passwd@hostName/dirName/fileName"
            print $file/content
        

Get the name of specified FTP files from specified directory recursively 5 times maximum 2 depth.

            $files from  "ftp://userName:passwd@hostName/dirName/" options "requests"=5 ,"depth"=2
            each $file in $files do [
                print $file@url
            ]
        

Get the name of specified FTP files from specified directory recursively 5 times maximum 2 depth where FTP files have 'txt' extension.

            $files from  "ftp://userName:passwd@hostName/dirName/" options "requests"=5 ,"depth"=2, "filter"=Simplex.create("*.txt")
            each $file in $files do [
                print $file@url
            ]
        

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Inherits: Concept, URIHandler

Constructor List

create (String $url)
top

Method List

static LogicalacceptsURI (String $uri)
LogicalcloseConnection
ConceptgetContent
Logicalinitialize (Map $options)
LogicalopenConnection
LogicalsetContent (Concept $value)
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML
Methods inherited from: URIHandler
acceptsURI, closeConnection, getContent, initialize, openConnection, setContent

Detailed Constructor Info

create (String $url)
Parameters:
$url :The url with which this FTPHandler will be created.

Creates a new FTPHandler concept with the given $url.

top

Detailed Method Info

static acceptsURI (String $uri)
Parameters:
$uri : The uri which will be tested if it is acceptable by this handler.
Returns: Logical

Returns true if the given $uri is acceptable by this handler, false otherwise.

top
closeConnection
Returns: Logical

Returns true.

top
getContent
Returns: Concept

Returns the content of this handler.

top
initialize (Map $options)
Parameters:
$options : Contains a filter with which the returned content will be filtered.
Returns: Logical
Exceptions:
badURL :
(Error)
If the URL is not valid.

Returns true if the FTPHandler was initilized successfully, false otherwise.

top
openConnection
Returns: Logical

Returns true if the connection can be establised with the remote server from this concept's url, false otherwise.

top
setContent (Concept $value)
Parameters:
$value :The value to be set.
Returns: Logical

Sets this FTPHandler content to the specified $value.

top