What is an Asset Directory?
  • 18 Feb 2022
  • 6 Minutes to read
  • Dark
    Light
  • PDF

What is an Asset Directory?

  • Dark
    Light
  • PDF

ProGet provides a robust infrastructure for hosting and distributing your application and component packages, and oftentimes it can be convenient to distribute assets related to those packages – certificate files, third-party installers, license key files, etc. - in ProGet as well.

While you could certainly package these files, they are inherently un-versioned, require no additional metadata, and packaging and unpackaging would create extra and unnecessary steps. Sometimes, a file is just a file, and ProGet asset directories provide the versatility of a file share, with the added benefit of security and stability features such as scoped privileges, retention policies, automatic failover, and feed replication. Setting up an asset directory in ProGet and migrating from a network share is straightforward.

Example: An installer may be used by a configuration script for setting up a workstation. The installer is already a self-contained package, so packaging it further would be redundant; it just needs to be downloaded and executed. It could simply be stored in an Asset Directory, and referenced by URL.

Asset Directory

An asset directory is a like a feed, except for arbitrary files instead of package files. You can access these files from your web browser and the RESTful API.

Internally, asset directories are represented as feeds, which means:

Note: Connectors are not currently supported for asset directories, but may be added in a future release. Please contact us if you are interested in these additions.

To create an asset directory, go to Assets > Create Asset Directory.

Files in an Asset Directory

Asset Directories are made up of files and sub-folders that can be accessed from your web browser and the RESTful API. You can view the file information, caching, metadata, and download information by clicking on a file in the ProGet Web UI. Files can also be accessed as if they are hosted on a web server by navigating to the file's URL (see asset directory API). This URL is also displayed on the file information page in the Web UI.

Adding Files

Files can be added to an asset directory in a number of ways. You can:

Add/Upload Files

These options can be found by clicking the Add/Upload Files button in the upper right corner.

  • Upload Files; upload a single file or multiple files using your browser.
  • Upload using an API; use the Asset Directory API to upload one or more files to the asset directory.
  • Import from a Zip File; upload a .zip or .tgz file using your browser and expand its contents into the asset directory.
  • Import from Amazon AWS; Download files stored in the cloud to this asset directory (Requires ProGet v6.0+ and the Amazon AWS Extension).
  • Import from Azure; Download files stored in the cloud to this asset directory (Requires ProGet v6.0+ and the Azure Extension).

Read how to use ProGet as a User-Interface for Amazon S3 and Azure Blog Storage in our step-by-step guides.

Import from a Drop Path

Starting in ProGet 6.0, you can configure an asset directory to use a "drop path," which is a local or network path that ProGet will periodically scan for files. If that directory contains a file, it will be imported into that asset directory.

To configure the Drop Path:

  1. Navigate to the asset directory
  2. Click Manage Directory in the multi-button in the upper right corner
  3. Select the Storage & Retention tab
  4. Click configure to the right of Drop Path
  5. Enter the local or network path to monitor

Note: When using a network path, you must configure read, write, and delete access for the account that the ProGet Windows service is running as.

Deleting Files

You can delete a file in asset directory by clicking the "X" on the file listings page, the "Delete File" button on the file overview page, or by using the asset directory API.

Media Types

When you upload a file to an asset directory, ProGet will attempt to determine the file's media type. The media type is sent as a content-type response header when the file is downloaded, which may be used by the downloading application or script. For example, if the content-type is application/msword, then a web browser may open Microsoft Word to display the file.

You can change the file's media type by:

  1. Navigate to the file in the web UI
  2. Click set to the right of Type
  3. Enter the content type you would like to return

You can also set the content-type by using the asset directory API.

Sub-folders

Similar to a file system, you can use sub-folders to organize the files in an asset directory. Sub-folders may also contain other sub-folders.

You can view or edit sub-folder properties by clicking the pencil to the right of the sub-folder in the list or navigating to the folder and clicking the Folder Properties button in the multi-button in the upper right corner.

Adding Sub-folders

You can add a sub-folder by navigating to that asset directory or a sub-folder, then clicking "Create Subfolder" in the multi-button in the upper right corner, or by using the asset directory API.

Deleting Sub-folders

You can delete a sub-folder by clicking the "X" on the file listings page, the "Delete Folder" button on the folder properties page, or by using the asset directory API.

Custom Metadata

Custom Metadata is available starting in ProGet v6.0.*

Files and Sub-folders can have additional metadata stored in ProGet. Examples of metadata could be creator information, internal notes, build information, release information, and more. Files can also include the metadata record as an HTTP header that is included in the HTTP download response.

File Metadata

You can add metadata to files by:

  1. Navigate to the file
  2. Click Add under the Additional Metadata section
  3. Enter the name and value of the metadata record
  4. Optionally, you can select Include as HTTP response header to send that record as an HTTP header value

Metadata can also be managed using the Asset Directory Metadata API.

Sub-folder Metadata

You can add metadata to a sub-folder by:

  1. Navigate to the folder's properties
    1. Click the pencil to the right of the sub-folder in the list
    2. Navigate to the folder and clicking the Folder Properties button in the multi-button in the upper right corner
  2. Click Add under the Additional Metadata section
  3. Enter the name and value of the metadata record

Metadata can also be managed using the Asset Directory Metadata API.

Client-side Caching

Client-side Caching is available starting in ProGet v6.0.

ProGet can instruct a user's browser or client tool to cache asset files in its local store, reducing the amount of requests made to your ProGet server. Custom client-side caching can be set at the file or sub-folder level that will then return proper cache headers with the HTTP download request. When a cache value is set on a sub-folder, all files and sub-folders contained within that folder will inherit that cache setting by default. You can override that setting on any child file or sub-folder. For example, you can set a folder to cache files for 30 minutes, but override a specific file in that folder to not cache it at all, while leaving the remaining files to use the inherited 30 minute cache setting.

To configure a caching:

  1. Navigate to a sub-folder's properties or to a file in the Web UI.
  2. Click set to the right of Cache Header
  3. Select and configure the cache type:
    1. (inherited); inherit the cache header from its parent sub-folder
    2. Do Not Cache; do not cache the file in its local cace
    3. Browser Cache TTL; cache the file for a specific amount of time in its local cache
      1. Short (30 minutes)
      2. Medium (2 weeks)
      3. Long (1 year)
      4. Custom; duration in seconds
    4. Custom Cache-Control Header; specify a custom Cache-Control header to be returned in with the download request
  4. Click Save

Client-side cache settings are client-side only, they will not enable/disable any server-side caching.


Was this article helpful?