Esempio n. 1
0
 /// <summary>
 /// Create a seafile session for the given authentication token
 /// Will automatically connect to the seafile server and check if the token is valid
 /// and retrieve the username for the given token
 /// </summary>
 public static async Task <SeafileSession> FromToken(Uri serverUri, string authToken)
 {
     return(await FromToken(SeafileConnectionFactory.GetDefaultConnection(), serverUri, authToken));
 }
Esempio n. 2
0
 /// <summary>
 /// Tries to connect to the given seafile server using the default ISeafWebConnection implementation and returns an appropriate session object on success
 /// </summary>
 /// <param name="serverUrl">The server url to connect to (including protocol (http or https) and port)</param>
 /// <param name="username">The username to login with</param>
 /// <param name="pwd">The password for the given user (will be overwritten with zeros as soon as the authentication request has been sent)</param>
 public static async Task <SeafileSession> Establish(Uri serverUri, string username, char[] pwd)
 {
     return(await Establish(SeafileConnectionFactory.GetDefaultConnection(), serverUri, username, pwd));
 }
Esempio n. 3
0
 /// <summary>
 /// Ping the server without authentication
 /// </summary>
 /// <param name="serverUri"></param>
 /// <returns></returns>
 public static async Task <bool> Ping(Uri serverUri)
 {
     return(await Ping(SeafileConnectionFactory.GetDefaultConnection(), serverUri));
 }
Esempio n. 4
0
 /// <summary>
 /// Retrieve some general information about the Seafile server at the given address
 /// </summary>
 /// <param name="seafWebConnection"></param>
 /// <param name="serverUri"></param>
 /// <returns></returns>
 public static async Task <SeafServerInfo> GetServerInfo(Uri serverUri)
 {
     return(await GetServerInfo(SeafileConnectionFactory.GetDefaultConnection(), serverUri));
 }
Esempio n. 5
0
 /// <summary>
 /// Create a seafile session for the given username and authentication token
 /// The validity of the username or token are not checked
 /// (if they are wrong you may not be able to execute requests)
 /// </summary>
 public static SeafileSession FromToken(Uri serverUri, string username, string authToken)
 {
     return(FromToken(SeafileConnectionFactory.GetDefaultConnection(), serverUri, username, authToken));
 }