-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added encapsulation of session configuration
- Loading branch information
1 parent
47c4a55
commit d7407e5
Showing
2 changed files
with
117 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
ical4j-connector-dav/src/main/java/org/ical4j/connector/dav/DavSessionConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.ical4j.connector.dav; | ||
|
||
import org.apache.http.client.CredentialsProvider; | ||
|
||
public class DavSessionConfiguration { | ||
|
||
private String user; | ||
|
||
private char[] password; | ||
|
||
private String bearerAuth; | ||
|
||
private CredentialsProvider credentialsProvider; | ||
|
||
private String workspace; | ||
|
||
public DavSessionConfiguration withUser(String user) { | ||
this.user = user; | ||
return this; | ||
} | ||
|
||
public DavSessionConfiguration withPassword(char[] password) { | ||
this.password = password; | ||
return this; | ||
} | ||
|
||
public DavSessionConfiguration withBearerAuth(String bearerAuth) { | ||
this.bearerAuth = bearerAuth; | ||
return this; | ||
} | ||
|
||
public DavSessionConfiguration withCredentialsProvider(CredentialsProvider credentialsProvider) { | ||
this.credentialsProvider = credentialsProvider; | ||
return this; | ||
} | ||
|
||
public DavSessionConfiguration withWorkspace(String workspace) { | ||
this.workspace = workspace; | ||
return this; | ||
} | ||
|
||
public String getUser() { | ||
return user; | ||
} | ||
|
||
public char[] getPassword() { | ||
return password; | ||
} | ||
|
||
public String getBearerAuth() { | ||
return bearerAuth; | ||
} | ||
|
||
public CredentialsProvider getCredentialsProvider() { | ||
return credentialsProvider; | ||
} | ||
|
||
public String getWorkspace() { | ||
return workspace; | ||
} | ||
} |