Standard Library/android

From J Wiki
Jump to navigation Jump to search
Overview | android | break | colib | compare | coutil | dates | debug | dir | dll | files | jade | jal | stdlib | strings | sysenv | text | unxlib

This script defines android utilities and is included in the J standard library. Definitions are loaded into the z locale.


A anddf, andunzip

anddf (verb)

Download a file via android's embedded http client overwriting target file.


'' anddf jpath'~temp/jwlogo.png'


x anddf y


>=0 success, number of bytes in file
 _1 unknown error
 _2 target file exists and is not writable
 _3 parent directory is not writable
 _5 malformed url
 _6 i/o exception during transport
 _99 web request returns invalid '0' status code
<= _100 negation of unsuccessful http response code (!=200), ie. _404 "Not Found"

andunzip (verb)

Monadically, it unzips the file at y into the same directory.

Optional x may specify an alternate output directory


andunzip y ; x andunzip y


 0 success
_1 generic i/o error
_2 zipfile not found
_3 output directory not writable
_4 zip format exception