18 val copy_file_base: Path.T * Path.T -> Path.T -> unit |
18 val copy_file_base: Path.T * Path.T -> Path.T -> unit |
19 val create_tmp_path: string -> string -> Path.T |
19 val create_tmp_path: string -> string -> Path.T |
20 val with_tmp_file: string -> string -> (Path.T -> 'a) -> 'a |
20 val with_tmp_file: string -> string -> (Path.T -> 'a) -> 'a |
21 val rm_tree: Path.T -> unit |
21 val rm_tree: Path.T -> unit |
22 val with_tmp_dir: string -> (Path.T -> 'a) -> 'a |
22 val with_tmp_dir: string -> (Path.T -> 'a) -> 'a |
23 val download: string -> string |
23 val download: string -> Bytes.T |
24 val download_file: string -> Path.T -> unit |
24 val download_file: string -> Path.T -> unit |
25 val decode_base64: string -> string |
25 val decode_base64: Bytes.T -> Bytes.T |
26 val encode_base64: string -> string |
26 val encode_base64: Bytes.T -> Bytes.T |
27 val isabelle_id: unit -> string |
27 val isabelle_id: unit -> string |
28 val isabelle_identifier: unit -> string option |
28 val isabelle_identifier: unit -> string option |
29 val isabelle_heading: unit -> string |
29 val isabelle_heading: unit -> string |
30 val isabelle_name: unit -> string |
30 val isabelle_name: unit -> string |
31 val identification: unit -> string |
31 val identification: unit -> string |
154 in Exn.release (Exn.capture f (make_directory path) before ignore (try rm_tree path)) end; |
154 in Exn.release (Exn.capture f (make_directory path) before ignore (try rm_tree path)) end; |
155 |
155 |
156 |
156 |
157 (* download file *) |
157 (* download file *) |
158 |
158 |
159 val download = Scala.function1 "download"; |
159 val download = Bytes.string #> Scala.function1_bytes "download"; |
160 |
160 |
161 fun download_file url path = File.write path (download url); |
161 fun download_file url path = Bytes.write path (download url); |
162 |
162 |
163 |
163 |
164 (* base64 *) |
164 (* base64 *) |
165 |
165 |
166 val decode_base64 = Scala.function1 "decode_base64"; |
166 val decode_base64 = Scala.function1_bytes "decode_base64"; |
167 val encode_base64 = Scala.function1 "encode_base64"; |
167 val encode_base64 = Scala.function1_bytes "encode_base64"; |
168 |
168 |
169 |
169 |
170 (* Isabelle distribution identification *) |
170 (* Isabelle distribution identification *) |
171 |
171 |
172 fun isabelle_id () = Scala.function1 "isabelle_id" ""; |
172 fun isabelle_id () = Scala.function1 "isabelle_id" ""; |