Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 20a33fb

Browse files
Added public API (in exported package)
1 parent 04369cb commit 20a33fb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/org/cryptomator/cloudaccess/CloudAccess.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
package org.cryptomator.cloudaccess;
22

3+
import java.net.URL;
34
import java.nio.file.Path;
45

56
import org.cryptomator.cloudaccess.api.CloudProvider;
67
import org.cryptomator.cloudaccess.localfs.LocalFsCloudProvider;
8+
import org.cryptomator.cloudaccess.webdav.WebDavCloudProvider;
9+
import org.cryptomator.cloudaccess.webdav.WebDavCredential;
710

811
public class CloudAccess {
912

1013
private CloudAccess() {
1114
}
1215

16+
/**
17+
* Creates a new CloudProvider which provides access to the given URL via WebDAV.
18+
*
19+
* @param url Base URL leading to the root resource
20+
* @param username Username used during basic or digest auth challenges
21+
* @param password Password used during basic or digest auth challenges
22+
* @return A cloud access provider that provides access to the given WebDAV URL.
23+
*/
24+
public static CloudProvider toWebDAV(URL url, String username, CharSequence password) {
25+
// TODO adapt types
26+
return WebDavCloudProvider.from(WebDavCredential.from(null, username, null));
27+
}
28+
1329
/**
1430
* Creates a new CloudProvider which provides access to the given <code>folder</code>. Mainly for test purposes.
1531
*

0 commit comments

Comments
 (0)