All Projects → melthaw → spring-file-storage-service

melthaw / spring-file-storage-service

Licence: Apache-2.0 license
The FSS(file storage service) APIs make storing the blob file easy and simple .

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to spring-file-storage-service

WebServerCloudBackups
Automatic backups your web projects bases and files to the clouds via WebDAV.
Stars: ✭ 20 (-39.39%)
Mutual labels:  s3, webdav
Filestash
🦄 A modern web client for SFTP, S3, FTP, WebDAV, Git, Minio, LDAP, CalDAV, CardDAV, Mysql, Backblaze, ...
Stars: ✭ 5,231 (+15751.52%)
Mutual labels:  s3, webdav
Kodexplorer
A web based file manager,web IDE / browser based code editor
Stars: ✭ 5,490 (+16536.36%)
Mutual labels:  s3, webdav
flask-fs
Simple and easy file storages for Flask
Stars: ✭ 30 (-9.09%)
Mutual labels:  s3, gridfs
Seaweedfs
SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lake, for billions of files! Blob store has O(1) disk seek, cloud tiering. Filer supports Cloud Drive, cross-DC active-active replication, Kubernetes, POSIX FUSE mount, S3 API, S3 Gateway, Hadoop, WebDAV, encryption, Erasure Coding.
Stars: ✭ 13,380 (+40445.45%)
Mutual labels:  s3, posix
awesome-storage
A curated list of storage open source tools. Backups, redundancy, sharing, distribution, encryption, etc.
Stars: ✭ 324 (+881.82%)
Mutual labels:  s3, glusterfs
Goofys
a high-performance, POSIX-ish Amazon S3 file system written in Go
Stars: ✭ 3,932 (+11815.15%)
Mutual labels:  s3, posix
Juicefs
JuiceFS is a distributed POSIX file system built on top of Redis and S3.
Stars: ✭ 4,262 (+12815.15%)
Mutual labels:  s3, posix
Cyberduck
Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
Stars: ✭ 1,080 (+3172.73%)
Mutual labels:  s3, webdav
Winscp
WinSCP is a popular free SFTP and FTP client for Windows, a powerful file manager that will improve your productivity. It supports also Amazon S3, FTPS, SCP and WebDAV protocols. Power users can automate WinSCP using .NET assembly.
Stars: ✭ 794 (+2306.06%)
Mutual labels:  s3, webdav
go-drive
A simple cloud drive mapping web app supports local, FTP/SFTP, S3, OneDrive, WebDAV, Google Drive.
Stars: ✭ 184 (+457.58%)
Mutual labels:  s3, webdav
Chubaofs
ChubaoFS (abbrev. CBFS) is a cloud native distributed file system and object store.
Stars: ✭ 2,482 (+7421.21%)
Mutual labels:  s3, posix
cubefs
CubeFS is a cloud native distributed storage platform.
Stars: ✭ 3,062 (+9178.79%)
Mutual labels:  s3, posix
minio-rclone-webdav-server
A @rclone served WebDAV server with @minio as the s3 storage backend docker example
Stars: ✭ 17 (-48.48%)
Mutual labels:  s3, webdav
mindav
A self-hosted file backup server which bridges WebDAV protocol with @minio written in @totoval. Webdav ❤️ Minio
Stars: ✭ 64 (+93.94%)
Mutual labels:  s3, webdav
Rclone
"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Yandex Files
Stars: ✭ 30,541 (+92448.48%)
Mutual labels:  s3, webdav
Uptoc
A static file deployment tool that supports multiple platforms./ 一个支持多家云厂商的静态文件部署工具
Stars: ✭ 159 (+381.82%)
Mutual labels:  s3, qiniu
Sftpgo
Fully featured and highly configurable SFTP server with optional HTTP, FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob
Stars: ✭ 3,534 (+10609.09%)
Mutual labels:  s3, webdav
WebDAVAjax
WebDAV AJAX Library for opening docs from a web page and saving back directly to server in a SharePoint-like manner.
Stars: ✭ 16 (-51.52%)
Mutual labels:  webdav
qiniu-laravel-storage
Qiniu 云储存 Laravel 5 Storage版
Stars: ✭ 520 (+1475.76%)
Mutual labels:  qiniu

Introduction

The fss(for file storage service) apis make storing the blob file easy and simple , the user can supply the provider impl to match the customize requirement if the default build-in impl is not enough.

Here is the support list:

  • Alioss
  • Qiniu
  • Amazon S3 Protocol
  • WebDav Protocol
  • Glusterfs
  • Gridfs
  • Zimg
  • Local File

Dependencies

Latest Release

So far the following version is available

category module name latest version
core daas-fss-core 3.0.8
physical file daas-fss-zimg 3.0.8
daas-fss-alioss 3.0.8
daas-fss-gridfs 3.0.8
daas-fss-glusterfs 3.0.8
daas-fss-hwobs 3.0.8
daas-fss-local 3.0.8
daas-fss-qiniu 3.0.8
daas-fss-s3 3.0.8
daas-fss-webdev 3.0.8
database daas-fss-mysql 3.0.8
daas-fss-mongodb 3.0.8

And 2.0.0 is deprecated.

Get Started

We will take WebDAV for example.

  • Start a file server supporting WebDAV protocol
  • Gradle as build tool
  • Show the API usage in Spring Application

Start WebDav server

please make sure docker & docker-compose are ready on your local machine.

We will quick start a WebDAV file server by docker-compose.

Here is the docker-compose.yml

version: '3'
services:

  webdav:
    container_name: fss-test-webdav
    image: bytemark/webdav
    ports:
      - "80:80"
    environment:
      AUTH_TYPE: Digest
      USERNAME: alice
      PASSWORD: secret1234

Start it with

docker-compose up -d

Now 80 port is exported as hosted port

Introduce to your project

Gradle build.gradle

    compile("in.clouthink.daas:daas-fss-core:3.0.8")
    compile("in.clouthink.daas:daas-fss-webdav:3.0.8")

Maven pom.xml

	<dependency>
		<groupId>in.clouthink.daas</groupId>
		<artifactId>daas-fss-core</artifactId>
		<version>3.0.8</version>
	</dependency>
        
	<dependency>
		<groupId>in.clouthink.daas</groupId>
		<artifactId>daas-fss-webdav</artifactId>
		<version>3.0.8</version>
	</dependency>

Spring

Application

@SpringBootApplication
@Import({WebDavAutoConfiguration.class})
@EnableConfigurationProperties(WebDavApplication.TestWebDavProperties.class)
public class WebDavApplication {

    @ConfigurationProperties(prefix = "fss.webdav")
    public static class TestWebDavProperties extends DefaultWebDavProperties {

    }

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(WebDavApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(new Object[]{WebDavApplication.class}, args);
    }

}

Spring application.yml

fss:
  webdav:
    username: alice
    password: secret1234
    endpoint: http://127.0.0.1

logging:
  level:
    in.clouthink: debug
    com.github.sardine: debug

Then let's create a test

@RunWith(SpringRunner.class)
@SpringBootTest(classes = WebDavApplication.class)
public class WebDavTest {

    @Resource
    @Qualifier("webdavStorage")
    private FileStorage fileStorage;

    private ClassPathResource pdfResource = new ClassPathResource("please_replace_with_your_test_file.pdf");

    @Test
    public void test() throws IOException {
        Assert.assertTrue(pdfResource.exists());

        DefaultStoreFileRequest request = new DefaultStoreFileRequest();
        request.setOriginalFilename(pdfResource.getFilename());
        request.setContentType(MediaType.APPLICATION_PDF.toString());
        StoreFileResponse response = fileStorage.store(pdfResource.getInputStream(), request);

        Assert.assertEquals("webdav", response.getProviderName());

        StoredFileObject storedFileObject = response.getStoredFileObject();
        Assert.assertNotNull(storedFileObject);

        storedFileObject = fileStorage.findByStoredFilename(storedFileObject.getStoredFilename());
        String saveToFilename = MetadataUtils.generateFilename(request);
        storedFileObject.writeTo(new FileOutputStream(saveToFilename), 1024 * 4);

        storedFileObject = fileStorage.delete(storedFileObject.getStoredFilename());
        Assert.assertNull(storedFileObject.getImplementation());
    }

}

Configuration Reference

Default implementation is build inside , here is the sample to quick enable it in Spring.

@EnableConfigurationProperties(WebDavApplication.TestWebDavProperties.class)
public class WebDavApplication {

    @ConfigurationProperties(prefix = "fss.webdav")
    public static class TestWebDavProperties extends DefaultWebDavProperties {

    }
    
    ...
}

Alioss

Definition

in.clouthink.daas.fss.alioss.support.OssProperties

Implementation

in.clouthink.daas.fss.alioss.support.DefaultOssProperties

Sample

fss:
  alioss:
    keyId: <your alioss key id>
    keySecret: <your alioss key secret>
    endpoint: oss-cn-shenzhen.aliyuncs.com
    defaultBucket: testfss
    clientConfiguration:
      socketTimeout: 5000
      connectionTimeout: 5000

FastDfs

Definition

in.clouthink.daas.fss.fastdfs.support.FastdfsProperties

Implementation

in.clouthink.daas.fss.fastdfs.support.DefaultFastdfsProperties

Sample

fss:
  fastdfs:
    connectTimeoutInseconds: 30
    networkTimeoutInSeconds: 60
    charset: UTF-8
    httpAntiStealToken: false
    httpSecretKey:
    httpTrackerHttpPort: 8080
    trackerServers:
      - tracker:22122

Glusterfs

Definition

in.clouthink.daas.fss.glusterfs.support.GlusterfsProperties

Implementation

in.clouthink.daas.fss.glusterfs.support.DefaultGlusterfsProperties

Sample

fss:
  glusterfs:
    server: glusterfs1
    volume: test-volume

Gridfs

Share the Spring Mongodb Data configuration and no more special.

spring:
  data:
    mongodb:
      uri: mongodb://${MONGODB_HOST:localhost}:${MONGODB_PORT:27017}/${MONGODB_DB:daas-fss}

Qiniu Cloud

Definition

in.clouthink.daas.fss.qiniu.support.QiniuProperties

Implementation

in.clouthink.daas.fss.qiniu.support.DefaultQiniuProperties

Sample

fss:
  qiniu:
    accessKey: <your qiniu access key>
    secretKey: <your qiniu secret ky>
    host: <your qiniu subdomain>.bkt.clouddn.com
    defaultBucket: testfss

Amazon S3 Protocol

Definition

in.clouthink.daas.fss.s3.support.S3Properties

Implementation

in.clouthink.daas.fss.s3.support.DefaultS3Properties

Sample

fss:
  s3:
    accessKey: <your s3 access key>
    secretKey: <your s3 secret key>
    endpoint: <your s3 endpoint>
    region: us-west-2
    bucketStyle: path
    defaultBucket: test
    clientConfiguration:
      connectionTimeout: 5000

WebDAV

Definition

in.clouthink.daas.fss.webdav.support.WebdavProperties

Implementation

in.clouthink.daas.fss.webdav.support.DefaultWebdavProperties

Sample

fss:
  webdav:
    username: alice
    password: secret1234
    endpoint: http://127.0.0.1

Zimg

Definition

in.clouthink.daas.fss.zimg.support.ZimgProperties

Implementation

in.clouthink.daas.fss.zimg.support.DefaultZimgProperties

Sample

fss:
  zimg:
    uploadEndpoint: http://127.0.0.1:4869/upload
    downloadEndpoint: http://127.0.0.1:4869
    adminEndpoint: http://127.0.0.1:4869/admin
    infoEndpoint: http://127.0.0.1:4869/info

Local File

Definition

in.clouthink.daas.fss.local.support.LocalFileProperties

Implementation

in.clouthink.daas.fss.local.support.DefaultLocalFileProperties

Sample

fss:
  local:
    store-path: <your local file store path>

Appendix - Build the source

Install all (skip test)

mvn clean install -Dmaven.test.skip=true

Build all

mvn clean package

Build single project

  • core
mvn -pl module/core clean package
# or
mvn --projects module/core clean package
  • alioss
mvn -pl module/alioss clean package -am
# or
mvn --projects module/alioss clean package --also-make
  • fastdfs
mvn -pl module/fastdfs lean package -am
# or
mvn --projects module/fastdfs clean package --also-make
  • glusterfs
mvn -pl module/glusterfs lean package -am
# or
mvn --projects module/glusterfs clean package --also-make
  • gridfs
mvn -pl module/gridfs lean package -am
# or
mvn --projects module/gridfs clean package --also-make
  • qiniu
mvn -pl module/qiniu lean package -am
# or
mvn --projects module/qiniu clean package --also-make
  • s3
mvn -pl module/s3 lean package -am
# or
mvn --projects module/s3 clean package --also-make
  • webdav
mvn -pl module/webdav lean package -am
# or
mvn --projects module/webdav clean package --also-make
  • zimg
mvn -pl module/zimg lean package -am
# or
mvn --projects module/zimg clean package --also-make
  • local
mvn -pl module/local lean package -am
# or
mvn --projects module/local clean package --also-make
  • mongodb
mvn -pl module/mongodb clean package -am
# or
mvn --projects module/mongodb clean package --also-make
  • mysql
mvn -pl module/mysql lean package -am
# or
mvn --projects module/mysql clean package --also-make
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].