read_scihub_login: Import / export / check SciHub username and password
Description
Read the SciHub login information (read_scihub_login()),
save new username and password (write_scihub_login())
or check their validity (check_scihub_login()).
Login information is stored in a file apihub.txt inside the
".sen2r" subfolder of the home directory. This functions allow to read
or write this file, and to edit them from inside the GUI.
Path of the file in which login information is saved.
If NA (default) it is automatically read from the package default location.
username
SciHub username.
password
SciHub password.
check
Logical: if TRUE (default), new credentials are checked
before writing them on apihub_path (if they are invalid, an error
is provided);
if FALSE, they are directly written.
append
Logical: if TRUE, new credentials are added
to the ones existing within apihub_path;
if FALSE (default), apihub_path is replaced with the new ones.
Value
read_scihub_login returns a matrix of credentials,
in which username is in the first column, password in the second.
check_scihub_login returns TRUE if credentials are valid,
FALSE elsewhere.
check_scihub_connection returns TRUE if internet connection
is available and SciHub is accessible, FALSE otherwise.