View Source Lightning.Storage.ProjectFileDefinition (Lightning v2.10.4)

This module provides functionality for managing the storage and retrieval of project files.

It handles operations related to storing project files, generating URLs for accessing these files, and constructing storage paths for exported files. It serves as an abstraction layer over the underlying storage mechanism provided by the Lightning.Storage module.

## Functions

  • store/2: Stores a file from a given source path into the storage system based on the file's path.
  • get_url/1: Retrieves the URL for accessing a stored file.
  • storage_path_for_exports/2: Constructs a storage path for exported files, defaulting to a .zip extension.

## Example Usage

  # Store a file
  Lightning.Storage.ProjectFileDefinition.store("/path/to/source", project_file)

  # Get a URL for the stored file
  url = Lightning.Storage.ProjectFileDefinition.get_url(project_file)

  # Get the storage path for an exported file
  path = Lightning.Storage.ProjectFileDefinition.storage_path_for_exports(project_file)

Summary

Functions

Link to this function

storage_path_for_exports(file, ext \\ ".zip")

View Source
Link to this function

store(source_path, file)

View Source