Пример #1
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="serverUri">The server uri 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 <SeafSession> Establish(Uri serverUri, string username, char[] pwd)
 {
     return(await Establish(SeafConnectionFactory.GetDefaultConnection(), serverUri, username, pwd));
 }
Пример #2
0
 /// <summary>
 ///     Retrieve some general information about the Seafile server at the given address
 /// </summary>
 /// <param name="serverUri">The server uri to get the info</param>
 /// <returns></returns>
 public static async Task <SeafServerInfo> GetServerInfo(Uri serverUri)
 {
     return(await GetServerInfo(SeafConnectionFactory.GetDefaultConnection(), serverUri));
 }
Пример #3
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 SeafSession FromToken(Uri serverUri, string username, string authToken)
 {
     return(FromToken(SeafConnectionFactory.GetDefaultConnection(), serverUri, username, authToken));
 }
Пример #4
0
 /// <summary>
 ///     Ping the server without authentication
 /// </summary>
 /// <param name="serverUri">The server uri to ping</param>
 /// <returns></returns>
 public static async Task <bool> Ping(Uri serverUri)
 {
     return(await Ping(SeafConnectionFactory.GetDefaultConnection(), serverUri));
 }
Пример #5
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 <SeafSession> FromToken(Uri serverUri, string authToken)
 {
     return(await FromToken(SeafConnectionFactory.GetDefaultConnection(), serverUri, authToken));
 }