HttpDirectory (クラス)
public sealed HttpDirectory {inherits NormalDirectory}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.IO.HTTP.
直接継承しているサブクラス: StemHttpDirectory

"http://<machine-name>/..." 以下または "https://<machine-name>/..." 以下の階層にある Directory

注意事項

HTTP は本来のディレクトリの概念を持たないので、HttpDirectory はファイルやディレクトリの一覧やファイル削除などの通常のディレクトリ操作の多くを実行できません。HttpDirectory は、特定の Url 操作を実行するためだけに存在し、これらは通常、Url のステム部分か Url.instantiate-Directory により返される値のどちらかです。

プロパティ
name:self の名前。
アクセサ public HttpDirectory.name:String
parent-dir:self を含む Directory
アクセサ public HttpDirectory.parent-dir:Directory
size:コレクションの要素数を返します。
アクセサ public HttpDirectory.size:int
url:グローバル リソースの名前空間にあるこの Directory のパス名を Url として返します。
アクセサ public HttpDirectory.url:Url
プロパティ 継承 Directory: url-separator
プロパティ 継承 Association-of: efficient-size, empty?, key-type
プロパティ 継承 Aggregate-of: element-type

メソッド
clone:コレクションのクローンを返します。
public {HttpDirectory.clone}:HttpDirectory
concat:self.urltail に連結して、新しい Url を作成します。

戻り値のクエリおよびアンカーは tail から解析されます。
public {HttpDirectory.concat tail:String}:Url
keys-to-Iterator:コレクションの各キーを含む Iterator-of を返します。
public {HttpDirectory.keys-to-Iterator}:{Iterator-of String}
remove:Association-of.remove を参照してください。
public {HttpDirectory.remove
key:String,
length:int = 1,
error-if-missing?:bool = true
}:void
to-Iterator:コレクションの各要素を含む Iterator-of を返します。
public {HttpDirectory.to-Iterator}:{Iterator-of any}
メソッド 継承 Directory: get, get-if-exists, key-exists?, set, special-entry?, url-valid-separator?
メソッド 継承 Association-of: clear, filter, filter-clone, filter-keys, filter-keys-clone, get-key, get-key-if-exists
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize




プロパティ詳細
name (アクセサ)
アクセサ public HttpDirectory.name:String

self の名前。

説明

self が Curl のディレクトリ階層にリンクされている場合、このメソッドはグローバル リソースの名前空間にある self の名前を返します。この場合、
{{url self.name}.resolve}
および
{{abs-url self.name}.resolve}
で生成される値は self に等しく (==) なります。

self がディレクトリ階層にリンクされていない場合、このアクセッサは self が後で Directory のいずれかにインストールされる予定があれば self のキーとして使用される単純な名前を返します。


parent-dir (アクセサ)
アクセサ public HttpDirectory.parent-dir:Directory

self を含む Directory

説明

selfDirectory 階層にインストールされていない場合は null になります。


size (アクセサ)
アクセサ public HttpDirectory.size:int

コレクションの要素数を返します。

戻り値

self の要素数を示すint


{value
    || Declare and initialize a hash table with
    || String keys and int elements.
    let price:{HashTable-of String, int} =
        {new {HashTable-of String, int},
             "apple", 56,
             "banana", 87,
             "cherry", 34
        }

    || Display a message indicating the size of
    || the hash table.
    {text There are {value price.size} elements in
        the hash table.}
}

注意事項

これは Association-of の抽象メソッドで、Association-of のサブクラス内で実装されます。


url (アクセサ)
アクセサ public HttpDirectory.url:Url

グローバル リソースの名前空間にあるこの Directory のパス名を Url として返します。






メソッド詳細
clone (メソッド)
public {HttpDirectory.clone}:HttpDirectory

コレクションのクローンを返します。

戻り値

Aggregate-of のサブクラスのインスタンス。オブジェクトは、self と同じデータ型およびデータを持ちます。

説明

クローンは、self と同じデータ型を持つ新しいオブジェクトです。クローンには、self の要素の簡易コピー(shallow copy) が含まれます。つまり、どちらかのコレクションの要素に新しいオブジェクトを代入すると、もう一方の一致した要素は元のオブジェクトを参照します。ただし、要素のオブジェクトを変更すると、両方のコレクションは変更したオブジェクトを参照します。


{value
    || Declare and initialize set-1 (the original set).
    let set-1:{Set-of String} =
        {new {Set-of String}, "apple", "banana", "cherry"}

    || Initialize set-2 with a clone of the contents of
    || set-1.
    let set-2:{Set-of String} = {set-1.clone}

    || Use a VBox to display the contents of set-2.
    || Iterate over the contents of set-2, adding them
    || to the VBox.  Then display the VBox.
    let message:VBox = {VBox}
    {for each-element:String in set-2 do
        {message.add each-element}
    }
    message
}

注意事項

これは Aggregate-of の抽象メソッドで、Aggregate-of のサブクラス内で実装されます。

注意事項

クローンの詳細については、『Curl 開発者ガイド』の「コレクション」で、使用しているコレクションのクローンに関するセクションを参照してください。


concat (メソッド)
public {HttpDirectory.concat tail:String}:Url

self.urltail に連結して、新しい Url を作成します。

戻り値のクエリおよびアンカーは tail から解析されます。



keys-to-Iterator (メソッド)
public {HttpDirectory.keys-to-Iterator}:{Iterator-of String}

コレクションの各キーを含む Iterator-of を返します。

戻り値

self の要素と同じパラメータ化データ型を持つ Iterator-of。つまり、self{Association-of int, String} の場合、このメソッドは {Iterator-of int} を返します。

説明

Iterator-of のキーの順序は、任意に指定できます (Association-of のインスタンスが、順序付けられたコレクションでない場合もあるからです)。


{value
    || Declare and initialize a hash table with
    || int keys and String elements.
    let my-table:{HashTable-of int, String} =
        {new {HashTable-of int, String},
             162094, "tom",
             439853, "dick",
             098627, "harry"
        }

    || Create an Iterator-of from the set.
    let my-iterator:{Iterator-of int} =
        {my-table.keys-to-Iterator}

    || Use a VBox to display the contents of my-iterator.
    || Iterate over the contents of my-iterator, adding
    || them to the VBox.  Then display the VBox.
    let message:VBox = {VBox}
    {for each-element:int in my-iterator do
        {message.add each-element}
    }
    message

    || Note that the order of the elements in a hash
    || table is arbitrary.
}

注意事項

for コンテナ ループを使って同じ結果を得ることもできます。ただし、この反復処理メカニズムをオーバーライドすると、予期外の結果が生じる可能性があるので、可能な限り for ループを使用してください。

注意事項

これは Association-of の抽象メソッドで、Association-of のサブクラス内で実装されます。


remove (メソッド)
public {HttpDirectory.remove
key:String,
length:int = 1,
error-if-missing?:bool = true
}:void

Association-of.remove を参照してください。

説明

key にセパレータ文字を含めないでください (Directory.url-separator を参照してください)。

lengthSequence-of.remove との互換性のためだけに用意されています。Directory に適用しても意味がないので、このメソッドは実行時に length が指定されていないことを強制します。

key が symlink を参照する場合、その symlink 自体は削除されます。remove の実行中に symlink をスナップすることはできません。


to-Iterator (メソッド)
public {HttpDirectory.to-Iterator}:{Iterator-of any}

コレクションの各要素を含む Iterator-of を返します。

戻り値

self 内の要素と同じパラメータ化データ型を持つ Iterator-of。つまり、self{Aggregate-of int} の場合、このメソッドは {Iterator-of int} を返します。

説明

Iterator-of の要素の順序は、コレクション型に依存します。配列などの順序付けられたコレクションの場合、このメソッドはその順序を保存します。ハッシュ テーブルやセットなどの順序づけられていないコレクションの場合、要素の順序は任意に指定できます。


{value
    || Create a new set.
    let my-set:{Set-of String} =
        {new {Set-of String}, "apple", "banana", "cherry"}

    || Create an Iterator-of from the set.
    let my-iterator:{Iterator-of String} = {my-set.to-Iterator}

    || Use a VBox to display the contents of my-iterator.
    || Iterate over the contents of my-iterator, adding
    || them to the VBox.  Then display the VBox.
    let message:VBox = {VBox}
    {for each-element:String in my-iterator do
        {message.add each-element}
    }
    message
}

注意事項

for コンテナ ループを使って同じ結果を得ることもできます。ただし、この反復処理メカニズムをオーバーライドすると、予期外の結果が生じる可能性があるので、可能な限り for ループを使用してください。

注意事項

これは Aggregate-of の抽象メソッドで、Aggregate-of のサブクラス内で実装されます。