https://github.com/vaadin-component-factory/directory-upload
https://github.com/vaadin-component-factory/directory-upload
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vaadin-component-factory/directory-upload
- Owner: vaadin-component-factory
- License: apache-2.0
- Created: 2024-09-18T14:27:48.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-20T22:13:36.000Z (6 months ago)
- Last Synced: 2025-02-07T23:26:55.487Z (3 months ago)
- Language: Java
- Size: 229 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Directory Upload Addon for Vaadin Flow
This project is a Upload extension that handles uploading of directories, by using the file explorer selection window or drag and drop.
This component is part of Vaadin Component Factory.
## Features
* Supports uploading directories by selecting or dragging and dropping them
* Concurrent maximum connection control
* Start and Retry buttons visibility control
* Server side custom pre-validation definition support## Running the component demo
Run from the command line:
- `mvn -pl directory-upload-demo -Pwar install jetty:run`Then navigate to `http://localhost:8080/`
## Installing the component
Run from the command line:
- `mvn clean install -DskipTests`## Profiles
### Profile "directory"
This profile, when enabled, will create the zip file for uploading to Vaadin's directory.### Profile "production"
This profile, when enabled, will execute a production build for the demo.## Using the component in a Flow application
To use the component in an application using maven,
add the following dependency to your `pom.xml`:
```org.vaadin.addons.componentfactory
directory-upload
${component.version}```
## How to Use
The following example shows how to implement all the features offered by the component:final DirectoryUpload upload = new DirectoryUpload(new MultiFileBuffer(e -> {
logger.info("File received with path: " + e);
return new TemporaryFileFactory().createFile(e);
}));
upload.setAutoUpload(false);
upload.setStartButtonVisible(false);
upload.setRetryButtonVisible(false);
upload.setMaxConnections(2);
upload.addFilesSelectedListener(event -> {
List files = event.getFiles();
files.forEach(file -> {
if (file.getName().contains("400")) {
upload.markFileWithError(file, "contains illegal characters
asdfasd ");
}
});
});## Flow documentation
Documentation for flow can be found in [Flow documentation](https://vaadin.com/docs/latest/flow/).## License
Apache Licence 2.0.
### Sponsored development
Major pieces of development of this add-on has been sponsored by Vaadin customers. Read more about Expert on Demand at: [Support](https://vaadin.com/support) and [Pricing](https://vaadin.com/pricing).