|
URL object
Prototype for URL objects. Is a kind of SerializableObject. Syntax
var local_url = new URL ("/home/bob/myfile.txt",
properties);
Parameterspath. String. Path to the file system object. It can be any
path as seen in Ellié Computing Merge (toward FTP/S sites,
to Source Code Controls, to your OS native file
system...)
Property Ofnone. Implemented InECMerge 2.1 DescriptionThe URL object contains a URL or URI as usual on Internet.
NotesThe "properties" member of a URL object and parameter in new URL( ) call follow the same convention. The members of this object represents the options depending on the scheme of the URL (local, FTP, SCC...), they contains the value for the advanced options (as they would be by the Source and Advanced options panels of the actual source). These objects share these members, in whichever scheme:
All the schemes which are URL based share these members (it excludes the 'simple' local file system paths):
In addition web urls support these properties (see Web Source Dialog Box for more info about each option):
The SCC command line client plug-in support these properties (see SCC Source Dialog Box for more info):
Properties
Methods
toString
ExamplesExample 1.Create a URL toward a server's root, then compose it with a sub-folder's path "pub/hello".
var my_dir = new URL ("ftp://server/");
See Also
Method toStringSyntaxfunction toString ( )
Parametersnone. Method OfURL object. Implemented InECMerge 2.1 DescriptionReturns the editable_path property, which does not contain authentication information. ExamplesExample 1.Displays a message box with 'ftp://server/': alert ( URL('ftp://login:password@server/') ); See Also
Method containsSyntaxfunction contains ( url )
Parametersurl. URL object or String. If url is a string URL (url) is called to make an URL object of it. Method OfURL object. Implemented InECMerge 2.1 DescriptionReturns true if url is logically contained by an hypothetical folder pointed to by this object. ExamplesExample 1.Displays 'true, false' by testing to containments: alert ( URL ("c:\\temp").contains ("c:\\temp\\dir") + ", " URL ("/home/user").contains ("/home/user2") ); See Also
Method composeSyntaxfunction compose ( sub_path )
Parameterssub_path. String. A sub-path to be composed with this URL object. Method OfURL object. Implemented InECMerge 2.1 DescriptionComposes sub_path with the path if this URL object, builds a new URL object and returns it. sub_path accepts the usual '.' and '..' notation to climb up the directories hierarchy. ExamplesExample 1.Logs the composition of /home/user1 with ../user2 (which is /home/user2): log ( URL("/home/user1").compose("../user2") ); See Also
Method is_target_folderSyntaxfunction is_target_folder ( )
Parametersnone. Method OfURL object. Implemented InECMerge 2.1 DescriptionReturns true if the file system object pointed to by this URL is a folder, false if it is file or it is not known. ExamplesExample 1.Displays 'true' on a Unix platform: alert ( URL("/").is_target_folder() ); See Also
|
|||||||||||||