{"id":19711663,"url":"https://github.com/melthaw/spring-file-storage-service","last_synced_at":"2025-10-04T14:59:34.559Z","repository":{"id":28417910,"uuid":"97923192","full_name":"melthaw/spring-file-storage-service","owner":"melthaw","description":"The FSS(file storage service) APIs make storing the blob file easy and simple .","archived":false,"fork":false,"pushed_at":"2022-12-16T01:42:22.000Z","size":415,"stargazers_count":41,"open_issues_count":9,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-29T18:49:13.527Z","etag":null,"topics":["alioss","glusterfs","gridfs","java","mongodb","posix","qiniu","s3","spring","webdav","zimg"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melthaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-21T08:10:17.000Z","updated_at":"2025-02-13T17:21:15.000Z","dependencies_parsed_at":"2023-01-14T08:47:07.488Z","dependency_job_id":null,"html_url":"https://github.com/melthaw/spring-file-storage-service","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/melthaw/spring-file-storage-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melthaw%2Fspring-file-storage-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melthaw%2Fspring-file-storage-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melthaw%2Fspring-file-storage-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melthaw%2Fspring-file-storage-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melthaw","download_url":"https://codeload.github.com/melthaw/spring-file-storage-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melthaw%2Fspring-file-storage-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278328166,"owners_count":25968900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alioss","glusterfs","gridfs","java","mongodb","posix","qiniu","s3","spring","webdav","zimg"],"created_at":"2024-11-11T22:13:13.207Z","updated_at":"2025-10-04T14:59:34.537Z","avatar_url":"https://github.com/melthaw.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nThe fss(for file storage service) apis make storing the blob file easy and simple , \nthe user can supply the provider impl to match the customize requirement if the default build-in impl is not enough.\n\nHere is the support list:\n\n* Alioss\n* Qiniu\n* Amazon S3 Protocol\n* WebDav Protocol\n* Glusterfs\n* Gridfs\n* Zimg\n* Local File\n\n# Dependencies\n\n# Latest Release\n\nSo far the following version is available \n\n|category  |module name | latest version |\n|---|---|---|\n| core | daas-fss-core | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-core/3.0.8)\n| physical file | daas-fss-zimg | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-zimg/3.0.8)\n| | daas-fss-alioss | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-alioss/3.0.8)\n| | daas-fss-gridfs | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-gridfs/3.0.8)\n| | daas-fss-glusterfs | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-glusterfs/3.0.8)\n| | daas-fss-hwobs | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-hwobs/3.0.8)\n| | daas-fss-local | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-local/3.0.8)\n| | daas-fss-qiniu | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-qiniu/3.0.8)\n| | daas-fss-s3 | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-alioss/3.0.8)\n| | daas-fss-webdev | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-webdav/3.0.8)\n| database | daas-fss-mysql | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-mysql/3.0.8)\n| | daas-fss-mongodb | [3.0.8](https://mvnrepository.com/artifact/in.clouthink.daas/daas-fss-mongodb/3.0.8)\n\n\u003e And 2.0.0 is deprecated.  \n\n# Get Started \n\nWe will take [WebDAV](http://www.webdav.org/) for example. \n\n* Start a file server supporting WebDAV protocol\n* Gradle as build tool\n* Show the API usage in Spring Application \n\n## Start WebDav server\n\n\u003e please make sure docker \u0026 docker-compose are ready on your local machine.\n\nWe will quick start a WebDAV file server by docker-compose.\n\nHere is the `docker-compose.yml`\n\n```yml\nversion: '3'\nservices:\n\n  webdav:\n    container_name: fss-test-webdav\n    image: bytemark/webdav\n    ports:\n      - \"80:80\"\n    environment:\n      AUTH_TYPE: Digest\n      USERNAME: alice\n      PASSWORD: secret1234\n```\n\nStart it with\n\n```sh\ndocker-compose up -d\n```\n\nNow `80` port is exported as hosted port \n\n## Introduce to your project\n\nGradle build.gradle\n\n```gradle\n    compile(\"in.clouthink.daas:daas-fss-core:3.0.8\")\n    compile(\"in.clouthink.daas:daas-fss-webdav:3.0.8\")\n```\n\nMaven pom.xml \n\n```xml\n\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003ein.clouthink.daas\u003c/groupId\u003e\n\t\t\u003cartifactId\u003edaas-fss-core\u003c/artifactId\u003e\n\t\t\u003cversion\u003e3.0.8\u003c/version\u003e\n\t\u003c/dependency\u003e\n        \n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003ein.clouthink.daas\u003c/groupId\u003e\n\t\t\u003cartifactId\u003edaas-fss-webdav\u003c/artifactId\u003e\n\t\t\u003cversion\u003e3.0.8\u003c/version\u003e\n\t\u003c/dependency\u003e\n\n```\n\n## Spring \n\nApplication\n\n```java\n@SpringBootApplication\n@Import({WebDavAutoConfiguration.class})\n@EnableConfigurationProperties(WebDavApplication.TestWebDavProperties.class)\npublic class WebDavApplication {\n\n    @ConfigurationProperties(prefix = \"fss.webdav\")\n    public static class TestWebDavProperties extends DefaultWebDavProperties {\n\n    }\n\n    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {\n        return application.sources(WebDavApplication.class);\n    }\n\n    public static void main(String[] args) {\n        SpringApplication.run(new Object[]{WebDavApplication.class}, args);\n    }\n\n}\n\n\n```\n\nSpring `application.yml`\n\n```yml\nfss:\n  webdav:\n    username: alice\n    password: secret1234\n    endpoint: http://127.0.0.1\n\nlogging:\n  level:\n    in.clouthink: debug\n    com.github.sardine: debug\n```\n\nThen let's create a test \n\n```java\n@RunWith(SpringRunner.class)\n@SpringBootTest(classes = WebDavApplication.class)\npublic class WebDavTest {\n\n    @Resource\n    @Qualifier(\"webdavStorage\")\n    private FileStorage fileStorage;\n\n    private ClassPathResource pdfResource = new ClassPathResource(\"please_replace_with_your_test_file.pdf\");\n\n    @Test\n    public void test() throws IOException {\n        Assert.assertTrue(pdfResource.exists());\n\n        DefaultStoreFileRequest request = new DefaultStoreFileRequest();\n        request.setOriginalFilename(pdfResource.getFilename());\n        request.setContentType(MediaType.APPLICATION_PDF.toString());\n        StoreFileResponse response = fileStorage.store(pdfResource.getInputStream(), request);\n\n        Assert.assertEquals(\"webdav\", response.getProviderName());\n\n        StoredFileObject storedFileObject = response.getStoredFileObject();\n        Assert.assertNotNull(storedFileObject);\n\n        storedFileObject = fileStorage.findByStoredFilename(storedFileObject.getStoredFilename());\n        String saveToFilename = MetadataUtils.generateFilename(request);\n        storedFileObject.writeTo(new FileOutputStream(saveToFilename), 1024 * 4);\n\n        storedFileObject = fileStorage.delete(storedFileObject.getStoredFilename());\n        Assert.assertNull(storedFileObject.getImplementation());\n    }\n\n}\n```\n\n# Configuration Reference\n\nDefault implementation is build inside , here is the sample to quick enable it in Spring. \n\n```java\n@EnableConfigurationProperties(WebDavApplication.TestWebDavProperties.class)\npublic class WebDavApplication {\n\n    @ConfigurationProperties(prefix = \"fss.webdav\")\n    public static class TestWebDavProperties extends DefaultWebDavProperties {\n\n    }\n    \n    ...\n}\n\n```\n\n\n## Alioss\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.alioss.support.OssProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.alioss.support.DefaultOssProperties`\n\nSample\n\n```yml\nfss:\n  alioss:\n    keyId: \u003cyour alioss key id\u003e\n    keySecret: \u003cyour alioss key secret\u003e\n    endpoint: oss-cn-shenzhen.aliyuncs.com\n    defaultBucket: testfss\n    clientConfiguration:\n      socketTimeout: 5000\n      connectionTimeout: 5000\n```\n\n## FastDfs\n\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.fastdfs.support.FastdfsProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.fastdfs.support.DefaultFastdfsProperties`\n\nSample\n\n```yml\nfss:\n  fastdfs:\n    connectTimeoutInseconds: 30\n    networkTimeoutInSeconds: 60\n    charset: UTF-8\n    httpAntiStealToken: false\n    httpSecretKey:\n    httpTrackerHttpPort: 8080\n    trackerServers:\n      - tracker:22122\n```\n\n\n\n## Glusterfs\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.glusterfs.support.GlusterfsProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.glusterfs.support.DefaultGlusterfsProperties`\n\nSample\n\n```yml\nfss:\n  glusterfs:\n    server: glusterfs1\n    volume: test-volume\n```\n\n\n## Gridfs\n\n\u003e Share the Spring Mongodb Data configuration and no more special.\n\n```yml\nspring:\n  data:\n    mongodb:\n      uri: mongodb://${MONGODB_HOST:localhost}:${MONGODB_PORT:27017}/${MONGODB_DB:daas-fss}\n```\n\n## Qiniu Cloud\n\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.qiniu.support.QiniuProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.qiniu.support.DefaultQiniuProperties`\n\nSample\n\n```yml\nfss:\n  qiniu:\n    accessKey: \u003cyour qiniu access key\u003e\n    secretKey: \u003cyour qiniu secret ky\u003e\n    host: \u003cyour qiniu subdomain\u003e.bkt.clouddn.com\n    defaultBucket: testfss\n```\n\n\n\n## Amazon S3 Protocol \n\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.s3.support.S3Properties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.s3.support.DefaultS3Properties`\n\nSample\n\n```yml\nfss:\n  s3:\n    accessKey: \u003cyour s3 access key\u003e\n    secretKey: \u003cyour s3 secret key\u003e\n    endpoint: \u003cyour s3 endpoint\u003e\n    region: us-west-2\n    bucketStyle: path\n    defaultBucket: test\n    clientConfiguration:\n      connectionTimeout: 5000\n```\n\n\n## WebDAV \n\nDefinition\n\n\u003e `in.clouthink.daas.fss.webdav.support.WebdavProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.webdav.support.DefaultWebdavProperties`\n\nSample\n\n```yml\nfss:\n  webdav:\n    username: alice\n    password: secret1234\n    endpoint: http://127.0.0.1\n```\n\n## Zimg\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.zimg.support.ZimgProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.zimg.support.DefaultZimgProperties`\n\nSample\n\n```yml\nfss:\n  zimg:\n    uploadEndpoint: http://127.0.0.1:4869/upload\n    downloadEndpoint: http://127.0.0.1:4869\n    adminEndpoint: http://127.0.0.1:4869/admin\n    infoEndpoint: http://127.0.0.1:4869/info\n\n```\n\n\n## Local File\n\n\nDefinition\n\n\u003e `in.clouthink.daas.fss.local.support.LocalFileProperties`\n\nImplementation \n\n\u003e `in.clouthink.daas.fss.local.support.DefaultLocalFileProperties`\n\nSample\n\n```yml\nfss:\n  local:\n    store-path: \u003cyour local file store path\u003e\n```\n\n\n# Appendix - Build the source\n\nInstall all (skip test)\n\n```shell\nmvn clean install -Dmaven.test.skip=true\n```\n\nBuild all\n\n```shell\nmvn clean package\n```\n\nBuild single project\n\n* core\n\n```shell\nmvn -pl module/core clean package\n# or\nmvn --projects module/core clean package\n```\n\n* alioss\n\n```shell\nmvn -pl module/alioss clean package -am\n# or\nmvn --projects module/alioss clean package --also-make\n```\n\n* fastdfs\n\n```shell\nmvn -pl module/fastdfs lean package -am\n# or\nmvn --projects module/fastdfs clean package --also-make\n```\n\n* glusterfs\n\n```shell\nmvn -pl module/glusterfs lean package -am\n# or\nmvn --projects module/glusterfs clean package --also-make\n```\n\n* gridfs\n\n```shell\nmvn -pl module/gridfs lean package -am\n# or\nmvn --projects module/gridfs clean package --also-make\n```\n\n* qiniu\n\n```shell\nmvn -pl module/qiniu lean package -am\n# or\nmvn --projects module/qiniu clean package --also-make\n```\n\n* s3\n\n```shell\nmvn -pl module/s3 lean package -am\n# or\nmvn --projects module/s3 clean package --also-make\n```\n\n* webdav\n\n```shell\nmvn -pl module/webdav lean package -am\n# or\nmvn --projects module/webdav clean package --also-make\n```\n\n* zimg\n\n```shell\nmvn -pl module/zimg lean package -am\n# or\nmvn --projects module/zimg clean package --also-make\n```\n\n* local\n\n```shell\nmvn -pl module/local lean package -am\n# or\nmvn --projects module/local clean package --also-make\n```\n\n* mongodb\n\n```shell\nmvn -pl module/mongodb clean package -am\n# or\nmvn --projects module/mongodb clean package --also-make\n```\n\n* mysql\n\n```shell\nmvn -pl module/mysql lean package -am\n# or\nmvn --projects module/mysql clean package --also-make\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelthaw%2Fspring-file-storage-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelthaw%2Fspring-file-storage-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelthaw%2Fspring-file-storage-service/lists"}