Raw Files over HTTP from a Maven Repository

Upload any file with curl and download it from the same URL. A Maven repository stores a file at any path you name and returns it from that path. The file does not have to look like a Maven artifact.

Every feature on every plan, from $99/month billed annually.

14 days free. No credit card required.

Serving developers since 2016 Founder-run, no venture capital

~/.netrc
machine your-org.mycloudrepo.io
login you@example.com
password YOUR_REPOSITORY_TOKEN
Upload and download
curl --netrc -T my-app-1.1.0.tar.gz https://your-org.mycloudrepo.io/repositories/your-repo/my-app/1.1.0/
curl --netrc -O https://your-org.mycloudrepo.io/repositories/your-repo/my-app/1.1.0/my-app-1.1.0.tar.gz

How a Maven repository serves a raw file

Each line below is how a repository URL behaves, as the raw files guide documents it.

  • Upload with PUT curl --upload-file sends a PUT of the file exactly as it is, and CloudRepo answers 200 with no body.
  • Download from the same path A GET at the path you uploaded to returns the file. Every download is served as application/octet-stream, whatever type the upload named.
  • Check without downloading A HEAD request answers 200 with a content-length header when a file is stored, and 404 Not Found when nobody stored that path.
  • Any path, up to 50 GB Paths use letters, digits and + _ - . ! * ' ( ) / @ ~, and your organization, repository and path together can be up to 1,024 characters. One file can be up to 50 GB; a larger file is refused with 413.
  • Repository tokens Sign in with a repository token that has Download and publish packages access. The username is the email address of the account that created the token, and the password is the token. A Download packages token cannot upload: it gets 403.
  • Overwrite Protection A new repository has Overwrite Protection on, so a second upload to a path that already holds a file is refused with 409 Conflict. Put each version at its own path, such as builds/1.4.0/app.tar.gz.

Upload, download and check a file

Four steps with curl. Replace your-org and your-repo with your organization and your repository.

Create a Maven repository and a token

Create a repository and choose Maven. Then create a repository token with Download and publish packages access to it. curl reads the credential from ~/.netrc, so it never appears on a command line. Keep the file readable by you alone (chmod 600 ~/.netrc).

~/.netrc
machine your-org.mycloudrepo.io
login you@example.com
password YOUR_REPOSITORY_TOKEN

Upload a file

Make a file, then send it with --upload-file, which sends a PUT of the file exactly as it is. curl exits 0 and CloudRepo answers 200 with no body.

Terminal
echo 'Hello from CloudRepo.' > hello.txt

curl --netrc --fail --upload-file hello.txt \
  https://your-org.mycloudrepo.io/repositories/your-repo/uploads/hello.txt

Download a file and check one

The address of a file is the repository URL plus the path you chose, with no leading slash. Ask for the headers alone to check that a file exists without downloading it.

Terminal
curl --netrc --fail --output hello-copy.txt \
  https://your-org.mycloudrepo.io/repositories/your-repo/uploads/hello.txt

curl --netrc --fail --head \
  https://your-org.mycloudrepo.io/repositories/your-repo/uploads/hello.txt

List a directory

The listing is an HTML page with each name, its last modified time and its size. A client that asks for a path ending in / and sends Accept: text/html gets it.

Terminal
curl --netrc --fail --header 'Accept: text/html' \
  https://your-org.mycloudrepo.io/repositories/your-repo/uploads/

Keep reading

The raw files guide lists every error a request can get and what to do about each.

The examples use curl, so they work from any shell, script or CI job.

Every plan includes human support and SSO. See pricing

Ready to simplify your artifact storage?

14 days free. No credit card required.

Starting at $99/month billed annually.

Chris Shellenbarger, founder of CloudRepo

Founder-run since 2016, with no venture capital. A real person answers within one business day. Usually it's me.

Chris, founder of CloudRepo