https://github.com/sql-mistermagoo/blazor.mm.solid.file.client
Blazor Library Wrapper around solid-file-client
https://github.com/sql-mistermagoo/blazor.mm.solid.file.client
Last synced: over 1 year ago
JSON representation
Blazor Library Wrapper around solid-file-client
- Host: GitHub
- URL: https://github.com/sql-mistermagoo/blazor.mm.solid.file.client
- Owner: SQL-MisterMagoo
- License: other
- Created: 2019-01-16T17:27:07.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2020-06-15T15:18:46.000Z (about 6 years ago)
- Last Synced: 2025-02-05T03:23:40.840Z (over 1 year ago)
- Language: C#
- Size: 1.81 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Blazor.MM.Solid.File.Client
Blazor Library Wrapper around solid-file-client
This is a Blazor library that can be used to connect/login to a Solid Pod (https://solid.community) to read files and folders.
### TODO
- [ ] Finish wrappers for all solid-file-client methods
- [ ] Add samples for all methods to the sample file browser app.
### Features
- [x] Login
- [x] Logout
- [x] ReadFolder
- [x] ReadFile
- [x] LoginChanged - event to notify subscriber pages that the user has logged in/out
- [x] NameChanged - event to notify subscriber pages that the user name (foaf:name) has been retrieved
### Usage
Add the library as a reference (not published anywhere yet - so you have to build it)
#### LoginChanged
```
bool IsLoggedIn;
protected override void OnInit()
{
SolidFileClient.LoginStateChanged += LoginChanged;
}
void LoginChanged(bool loggedin)
{
IsLoggedIn = loggedin;
StateHasChanged();
}
```
#### Login
```
Task DoLogin()
{
return SolidFileClient.Login(Webid);
}
```
#### Logout
```
Task DoLogout()
{
return SolidFileClient.Logout();
}
```
#### ReadFolder
```
Folder[] folders;
File[] files;
Task ReadFolder(string path)
{
var folder = await SolidFileClient.ReadFolder(path);
folders = folder?.folders;
files = folder?.files;
}
```