- Saved searches
- Use saved searches to filter your results more quickly
- License
- jveverka/file-server
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Saved searches
- Use saved searches to filter your results more quickly
- License
- josecoelho/yep-rest-file-server
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Simple file server providing REST APIs to access remote file system.
License
jveverka/file-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This FileServer makes specified base directory accessible via REST APIs allowing you to list, download, upload, move and delete files and create empty directories. It also provides user access control and security.
- Standalone java server, running on linux system.
- Runs on the top of file system of host server.
- Provides access via REST APIs to the file system.
- File system operations supported
- list / read content of the directory
- download file, upload file
- create empty directory
- delete file or directory
- move file or directory
- get audit data for resource (file or directory) like number of downloads, uploads, .
- web UI / web client for REST APIs
- compressed directory download
- compressed directory upload
FileServer may be configured in several distinct ways. Check configurations examples chapter for more examples.
Requirements for developers
- JDK 11 or later (JDK 8 is supported as well)
- Requires read/write access to base directory on local file system.
All REST endpoints use ‘dynamic’ path. This means that path ** is used as relative path in base directory. See also postman collection example.
- GEThttp://localhost:8888/services/files/list/** — list content directory or subdirectory
curl -X GET http://localhost:8888/services/files/list/ -b /tmp/cookies.txt
- GEThttp://localhost:8888/services/files/download/** — download file on path. file must exist.
curl -X GET http://localhost:8888/services/files/download/path/to/001-data.txt -b /tmp/cookies.txt
- POSThttp://localhost:8888/services/files/upload/** — upload file, parent directory(ies) must exist before upload
curl -F ‘file=@/local/path/to/file.txt’ http://localhost:8888/services/files/upload/path/to/001-data.txt -b /tmp/cookies.txt
Delete files and/or directories
- DELETEhttp://localhost:8888/services/files/delete/** — delete file or directory
curl -X DELETE http://localhost:8888/services/files/delete/path/to/001-data.txt -b /tmp/cookies.txt
- POSThttp://localhost:8888/services/files/createdir/** — create empty directory
curl -X POST http://localhost:8888/services/files/createdir/path/to/directory -b /tmp/cookies.txt
- POSThttp://localhost:8888/services/files/move/** — move file or directory. If source is file, destination must be also a file, If source is directory, destination must be directory as well. curl -X POST http://localhost:8888/services/files/move/path/to/source -b /tmp/cookies.txt -d ‘< "destinationPath": "path/to/destination" >»
- GEThttp://localhost:8888/services/files/audit/** — get audit data for the resource. curl -X GET http://localhost:8888/services/files/audit/path/to/source -b /tmp/cookies.txt
In order to use file server REST endpoints above, user’s http session must be authorized. Users have defined their roles and access rights to files and directories. See this example of server configuration.
- POSThttp://localhost:8888/services/auth/login
curl -X POST http://localhost:8888/services/auth/login -H «Content-Type: application/json» -d ‘< "userName": "master", "password": "secret" >‘ -c /tmp/cookies.txt
Selected role fileserver.admin.role is used for admin access. Users with this role have access to special dedicated REST endpoints. See this example of server configuration. Refer to attached postman collection for all admin APIs.
Implemented admin features
- get volume information — base directory, used and free space
- get all open/active user sessions
- terminate selected user’s session
- user management
- get name of admin role
- get name of anonymous role
- list all users
- create new user
- remove user
- list all access filters
- create new access filter
- remove existing access filter
- login / logout events
- file access events (download, upload, delete, . all events are recorded)
- user management events
- file access filter management events
docker run -d --name file-server-1.3.0 \ --restart unless-stopped \ -e SERVER_PORT=8888 \ -p 8888:8888 jurajveverka/file-server:1.3.0
docker run -d --name file-server-1.3.0 \ --restart unless-stopped \ -e SERVER_PORT=8888 \ -e APP_CONFIG_PATH=/opt/data/config/application.yml \ -v '$':/opt/data/config \ -v '$':/opt/data/files \ -p 8888:8888 jurajveverka/file-server:1.3.0
Variable fileserver.home in application.yml file defines base directory to be exposed via REST APIs.
gradle clean build test java -jar build/libs/file-server-1.3.0-SNAPSHOT.jar --spring.config.location=file:./src/main/resources/application.yml
About
Simple file server providing REST APIs to access remote file system.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
This is a simple JAVA WEB project to be used as a File Server using REST API.
License
josecoelho/yep-rest-file-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This is a simple JAVA project to be used as a File Server using REST API.
You can use to store your files on another place, and consume everything from a HTTP API. Upload files specifying a path, create new revisions, list files on a path, download files or download revisions.
Its simple, but usefull if you want to move your storage to another place. I know, I know. «But why not Amazon S3?» you say. Well. there you cannot read the code and learn from that, and with this code you can have yout own File Server.. thats not awsome? :p
To run this project as is, you will need to setup:
All failed requisitions will have your equivalent HTTP Response Code, and on the body a JSON explaing the problem.
- 400: Invalid parameters. More details on body as JSON
- 404: File or path not found
- 405: Unexpected request method. Usually GET or POST
- 5xx: Server error. More details on body as JSON