| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This sample provides a WebDAV server running on the Spring Boot framework with files being stored in the file system. The WebDAV requests are processed in a dedicated context, while the rest of the website processes regular HTTP requests, serving web pages. Documents are being published from the file system while the locks and custom attributes are being stored in Alternating Data Streams (in case of NTFS) or in Extended Attributes (in case of Linux and macOS).
This sample can be downloaded in the product download area as well as it is published on GitHub. It is available for both jakarta and javax.
This sample is using IT Hit WebDAV Ajax Library to display and browse server content on a default web page as well as to open documents for editing from a web page and save back directly to the server.
/dev/sda1 / ext4 errors=remount-ro,user_xattr 0 1
webdav.license=C:\License.licThe IT Hit Java WebDAV Server Library is fully functional and does not have any limitations. However, the trial period is limited to 1 month. After the trial period expires the Java WebDAV Server will stop working.
webdav.rootFolder=C:\Storage
webdav.rootContext=/DAV/Note: Some WebDAV clients (such as some old versions or Mini-redirector, Microsoft Web Folders, and MS Office 2007 and earlier) will fail to connect to a non-root server. They submit configuration requests to server root and if they do not get the response they will not be able to connect. For this reason, this sample processes OPTIONS and PROPFIND requests on all folders, including on the site root (https://server/). See also Making Microsoft Office to Work with WebDAV Server and Opening Microsoft Office Documents and Other Types of Files for Editing From a Web Page.
mvnw spring-boot:run
If everything was set up properly you should see a sample web page on https://server/DAV/ URL with a list of sample files and folders from your storge folder in the file system, configured in step 2. Now you can open documents for editing, manage documents, as well as connect to the server with any WebDAV client.
If anything goes wrong examine the log file. For Spring Boot, the log file is usually located at springboot/log/engine.log. You may also need to capture and examine the HTTP requests. See this article for more details.
This sample supports Anonymous access as well as MS-OFBA authentication against Azure AD. By default, the authentication is disabled and this sample allows full anonymous access.
To enable the MS-OFBA, uncomment MS-OFBA settings block in the application.properties file of the sample.
## This is Azure security configuration section. ## If you want to use Azure login - uncomment configurations bellow. # Specifies your Active Directory ID: #azure.activedirectory.tenant-id= # Specifies your App Registration's Application ID: #azure.activedirectory.client-id= # Specifies your App Registration's secret key: #azure.activedirectory.client-secret=
To get these properties you must register new (or use existing) application under your Azure Active Directory. To register the new Azure AD application follow these steps:
Navigate to Azure Active Directory -> App Registrations. Select New Registration.
Enter the app name. You MUST also enter the Redirect URI. Confirm registration.
Open the newly created app registration.
Copy the Application (client) ID and Directory (tenant) ID fields and paste them into client-id and tenant-id settings in the application.properties file.
Navigate to Certificates & secrets. Select New client secret. Enter the secret name and confirm the client secret creation.
Copy the newly created secret value and past it into client-secret setting in the application.properties file.
After getting all data put it in properties file and run the sample. You will get Azure login screen on attemp to access WebDAV page.
On the diagram below you can see the classes in the WebDAV SpringBoot sample:
To adapt the sample to your needs, you will modify these classes to read and write data from and into your storage. You can find more about this in Creating a Class 1 WebDAV Server and Creating Class 2 WebDAV Server article as well as in the class reference documentation.
Spring Boot WebDAV Server Example with Oracle Back-end, Java
| Back | FazBrowse Home | New Git URL |