This concept is working with FTP files.
With this concept you can get or set FTP file content,
can verify if the specified FTP file is a file or is a directory,
and if is a directory you can read a contents of directory.
Create specified file on FTP server and set the content of this file.
$page = FTPFile.create("ftp://userName:passwd@hostName/dirName/fileName")
$page.setcontent("This is a test.")
Methods inherited from: Concept
| cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
| Label: | contentType |
| Type: | String |
| Is Static: | false |
| Is Hidden: | false |
| Show Empty: | true |
A String indicating this FTPFile content type.
| Label: | length |
| Type: | Integer |
| Is Static: | false |
| Is Hidden: | false |
| Show Empty: | true |
An Integer indicating this FTPFile length.
| Label: | url |
| Type: | String |
| Is Static: | false |
| Is Hidden: | false |
| Show Empty: | true |
A String indicating this FTPFile url.
| Label: | content |
| Type: | String |
| Is Static: | false |
| Is Hidden: | false |
| Is Multi: | false |
| Show Empty: | true |
A String containing this FTPFile content.
| Parameters: |
| $url : | The url with which this FTPFile will be created. |
|
| Exceptions: |
unsupportedProtocolException :
(Error) | If the specified protocol not supported by FTPFile. |
badURLException :
(Error) | If the URL isn't valid. |
IOException :
(Error) | If the socket could not be opened. |
FTPOperationException :
(Error) | If an error occured when executing FTP command. |
Creates a new FTPFile concept with the given $url.
Returns true if this FTPFile is already exists, false otherwise.
$file = FTPFile.create("ftp://guest:guest@hostName/mydir/test.txt")
print $file.exists
-- the result is --
true
| Exceptions: |
FTPOperationException :
(Error) | If unable to execute FTP command. |
Returns the content of this FTPFile as String concept if the content type is text
or ByteArray concept otherwise.
$file = FTPFile.create("ftp://guest:guest@hostName/mydir/test.txt")
print $file.getContent
-- the result is --
This is the file content.
| Exceptions: |
FTPOperationException :
(Error) | If unable to execute FTP command. |
Returns the directories from this FTPFile concept url.
$file = FTPFile.create("ftp://guest:guest@hostName/mydir/")
print $file.getLinks
-- the result is --
ftp://guest:guest@hostName/mydir/docs
ftp://guest:guest@hostName/mydir/images
ftp://guest:guest@hostName/mydir/test.txt
Returns true if this FTPFile concept's url is a file, false otherwise.
$file = FTPFile.create("ftp://guest:guest@hostName/mydir/")
print $file.isFile
$file = FTPFile.create("ftp://guest:guest@hostName/mydir/test.txt")
print $file.isFile
-- the result is --
false
true
| Parameters: |
| $value : |
The value to be set.
The $value must be a String or a ByteArray concept. |
|
| Exceptions: |
unsupportedContentException :
(Error) | If $content parameter isn't a String or a ByteArray concept. |
FTPOperationException :
(Warning) | If unable to set content of FTPFile. |
FTPOperationException :
(Error) | If unable to execute FTP command. |
Sets this FTPFile content to the specified $value.
$file = FTPFile.create("ftp://guest:guest@hostName/mydir/test.txt")
print $file.getContent
$file.setContent("and this is the new content.")
print $file.getContent
-- the result is --
This is the file content.
and this is the new content.