Object naming considerations

The following considerations apply to object names.

Names ending with a forward slash

A forward slash at the end of a name indicates that the item is a directory. So, for example, if you include a forward slash at the end of the object name in a request to store an object, HCP creates an empty directory with that name and does not store the object.

Object names with non-ASCII, nonprintable characters

When you store an object with non-ASCII, nonprintable characters in its name, those characters are percent-encoded in the name displayed back to you.

Regardless of how the name is displayed, the object is stored with its original name, and you can access it either by its original name or by the names with the percent-encoded characters.

Object names and access through the CIFS and NFS protocols

The CIFS and NFS protocols cannot handle object or directory names that are longer than 255 bytes. An object stored through HSwift is inaccessible through CIFS and NFS if:

  • The object name is longer than 255 bytes and does not include any forward slashes.
  • The object name includes one or more forward slashes and any part of the name is longer than 255 bytes. In this case, a part of an object name is any character string that either precedes the first forward slash, comes between two forward slashes, or follows the last forward slash.

Percent-encoding special characters

With the HSwift API, object names are specified in URLs. Some characters have special meaning in URLs and may be interpreted incorrectly when used for other purposes. To avoid ambiguity, percent-encode the special characters listed in the table below.

CharacterPercent-encoded values
Space%20
Tab%09
New line%0A
Carriage return%0D
+%2B
%%25
#%23
?%3F
&%26
\&5C

UTF-8 encoding

These considerations apply to using UTF-8 encoding for object names:

  • Some character-set encoding schemes, such as UTF-8, can require more than one byte to encode a single character. As a result, such encoding can invisibly increase the length of an object name, causing it to exceed the HCP limit of 4,095 bytes.
  • When searching containers, Data Discovery Suite and HCP rely on UTF-8 encoding conventions to find objects by name. If the name of an object is not UTF-8 encoded, searches for the object by name may return unexpected results.
  • When the metadata query engine or HCP search facility indexes an object with a name that includes certain characters that cannot be UTF‑8 encoded, it percent-encodes those characters. Searches for such objects by name must explicitly include the percent-encoded characters in the name.