]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/getter/http_getter_storage.mli
ocaml 3.09 transition
[helm.git] / helm / ocaml / getter / http_getter_storage.mli
1 (* Copyright (C) 2004-2005, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26 (** Transparent handling of local/remote getter resources.
27  * Configuration of this module are prefix mappings (see
28  * Http_getter_env.prefixes). All functions of this module take as input an URI,
29  * resolve it using mappings and act on the resulting resource which can be
30  * local (file:/// scheme or relative path) or remote via HTTP (http:// scheme).
31  *
32  * Each resource could be either compressed (trailing ".gz") or non-compressed.
33  * All functions of this module will first loook for the compressed resource
34  * (i.e. the asked one ^ ".gz"), falling back to the non-compressed one.
35  *
36  * All filenames returned by functions of this module exists on the filesystem
37  * after function's return.
38  *
39  * Almost all functions may raise Resource_not_found, the following invariant
40  * holds: that exception is raised iff exists return false on a given resource
41  * *)
42
43 exception Resource_not_found of string * string  (** method, uri *)
44
45   (** @return a list of string where dir are returned with a trailing "/" *)
46 val ls: string -> string list
47
48
49   (** @return the filename of the resource corresponding to a given uri. Handle
50    * download and caching for remote resources.
51    * @param find if set to true all matching prefixes will be searched for the
52    * asked resource, if not only the best matching prefix will be used. Note
53    * that the search is performed only if the asked resource is not found in
54    * cache (i.e. to perform the find again you need to clean the cache).
55    * Defaults to false *)
56 val filename: ?find:bool -> string -> string
57
58   (** only works for local resources
59    * if both compressed and non-compressed versions of a resource exist, both of
60    * them are removed *)
61 val remove: string -> unit
62
63 val exists: string -> bool
64 val resolve: string -> string
65
66 val clean_cache: unit -> unit
67