Ellié Computing Home Page
My Shopping Cart

Your shopping cart is empty

Display Cart

Call us at +1 586 62 ELLIE / +1 586 62 35543 Office Closed
sales@elliecomputing.com - Contact us


URL object

 

 

 Prototype for URL objects. Is a kind of SerializableObject.

Syntax

var local_url = new URL ("/home/bob/myfile.txt", properties);
var ftp_url = new URL ("ftp://server/pub/thefile.txt", properties);

Parameters

path. 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...)
properties. Object. See the Notes below.

Property Of

none.

Implemented In

ECMerge 2.1

Description

The URL object contains a URL or URI as usual on Internet.
Note: URL objects are so called immutable objects (that's why all their properties are Read-Only). It means that once constructed an URL can never be modified, it has the advantage that such an object can then be shared anywhere without the risk of it being altered in an unexpected way (by a portion of code that you do not master).

Notes

The "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:

  • path. String. Path as expressed in the URL (not treated or decomposed)
  • scheme. String. The scheme as in "scheme://server/"

All the schemes which are URL based share these members (it excludes the 'simple' local file system paths):

  • server. String. Name of the server or IP address
  • port. String. Port of the server program.
  • query. String. Part after the '?' in the URL
  • fragment. String. Part after the '#' in the URL, also known as the anchor.
  • password. String. Password to connect
  • user. String. User to connect

 In addition web urls support these properties (see Web Source Dialog Box for more info about each option):

  • anonymous_connection. Boolean. Anonymous login (Deprecated, use authentication_kind instead)
  • authentication_kind. One of "anonymous", "password", "private-key", "agent".  Indicates which kind of authentication method to use.
  • explicit_auth. Boolean. Upgrade to SSL with AUTH command
  • max_connections. Integer. Use N parallel connections
  • no_proxy. Boolean. Do not use proxy
  • passive_mode. Boolean. Passive mode
  • ssl_verify_host. Boolean. Verify host.
  • ssl_verify_peer. Boolean. Verify peer certificate authenticity
  • try_recursive. Boolean. Try recursive listing

 The SCC command line client plug-in support these properties (see SCC Source Dialog Box for more info):

  • branch. String. Branch
  • compress. Boolean. Compress
  • database. String. Database
  • encrypt. Boolean. Encrypt
  • label. String. Label
  • max_connections. Integer. Use N parallel connections
  • recursive_only_for. String. Recursive only for folders matching
  • repository_path. String. Path (in the repository, not the URL path)
  • restrict_recrusive. Boolean. Enables the Recursive only for folders matching field
  • revision. String. Revision
  • try_recursive. Boolean. Try recursive listing

Properties

Property Description
browser_path String. Read-Only. Path as it would be provided to a browser, so as to open the item
editable_path String. Read-Only. Path as it appears in URL text or combo field (i.e. without authentication information)
path String. Read-Only. Path inside a server
properties Object. Read-Only. Provides information about the decomposed URL and advanced options
title String. Read-Only. Title for the item, generally the same as the path, but some schemes may provide something nicer

Methods

toString
compose
contains
is_target_folder

Examples

Example 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/");
my_dir = my_dir.compose ("pub/hello");

See Also 

  SerializableObject object, VFS object.

Method toString

Syntax

function toString ( )
returns a String

Parameters

none.

Method Of

URL object.

Implemented In

ECMerge 2.1

Description

Returns the editable_path property, which does not contain authentication information.

Examples

Example 1.

Displays a message box with 'ftp://server/':

alert ( URL('ftp://login:password@server/') );

See Also 

  URL object

Method contains

Syntax

function contains ( url )
returns a Boolean

Parameters

url. URL object or String. If url is a string URL (url) is called to make an URL object of it.

Method Of

URL object.

Implemented In

ECMerge 2.1

Description

Returns true if url is logically contained by an hypothetical folder pointed to by this object.

Examples

Example 1.

Displays 'true, false' by testing to containments:

alert ( URL ("c:\\temp").contains ("c:\\temp\\dir") + ", " URL ("/home/user").contains ("/home/user2") );

See Also 

  URL object

Method compose

Syntax

function compose ( sub_path )
returns a URL object

Parameters

sub_path. String. A sub-path to be composed with this URL object.

Method Of

URL object.

Implemented In

ECMerge 2.1

Description

Composes 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.

Examples

Example 1.

Logs the composition of /home/user1 with ../user2 (which is /home/user2):

log ( URL("/home/user1").compose("../user2") );

See Also 

  URL object

Method is_target_folder

Syntax

function is_target_folder ( )
returns a Boolean.

Parameters

none.

Method Of

URL object.

Implemented In

ECMerge 2.1

Description

Returns true if the file system object pointed to by this URL is a folder, false if it is file or it is not known.

Examples

Example 1.

Displays 'true' on a Unix platform:

alert ( URL("/").is_target_folder() );

See Also 

  URL object