IPWorks Cloud 2020 Java Edition

Questions / Feedback?

Delimiter Property

The delimiter string to use when listing files.

Syntax

public String getDelimiter();
public void setDelimiter(String delimiter);

Default Value

""

Remarks

If this property is non-empty when ListFiles or ListFileVersions is called, any items whose names contain the same string between the specified Prefix and the first occurrence of the specified delimiter that follow will be rolled up into a virtual "folder" element, which is returned in place of the individual files themselves.

If a particular item is a "folder" instead of an actual file or file version, then the Files.Kind field will be set to folder. The same is also true of the FileList event's Kind parameter.

File Hierarchy Traversal

By using the Delimiter and Prefix properties in tandem, applications can effectively "traverse" a virtual hierarchy of files (or file versions) as if it were a filesystem. For example, assume that files with the following names exist within a bucket:

  • MyCompany
  • MyCompany/Department1
  • MyCompany/Department2
  • MyCompany/Department2/EmployeeA
  • MyCompany/Department2/EmployeeB

With Delimiter set to /, we can set Prefix to successively "deeper" values before calling ListFiles or ListFileVersions for the following effect:

Prefix Value Files Returned Folders Returned
(empty) MyCompany MyCompany/
MyCompany/ MyCompany/Department1
MyCompany/Department2
MyCompany/Department2/
MyCompany/Department2/ MyCompany/Department2/EmployeeA
MyCompany/Department2/EmployeeB
(none)

This property is not available at design time.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Java Edition - Version 20.0 [Build 8265]