Java web app file server

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

Оцените статью