---
title: "Generator: GetFolderInfo"
source: https://dev.pageseeder.com/reference/advanced/website/berlioz/generators/org.weborganic.bastille.psml.GetFolderInfo.html
description: "Returns information about a file in the WEB-INF/psml based on the specified by the path info"
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~622
---

# Generator: GetFolderInfo

| Property | Value |
| --- | --- |
| Class name: | org.weborganic.bastille.psml.GetFolderInfo |
| Version: |  |
| Library: | Bastille |
| Cacheable: | Yes |
| Generated: | 2012-12-21 |

## Description

Returns information about a folder from the PSML folder using the specified `path` parameter.

This generator is useful to provide a tree of all the files within a folder.

> **Note:** When accessing file from the *content* folder, it is often preferable to use the [GetContentFolderInfo](org.weborganic.bastille.psml.GetContentFolderInfo.md) or [GetContentFolderInfoAuto](org.weborganic.bastille.psml.GetContentFolderInfoAuto.md) generators.

### Configuration

No configuration is required.

The root of the PSML folder can be configured using the global property `bastille.psml.root` which can be either an absolute path or a relative path from the global repository.

By default, the PSML root is set to `psml` which usually corresponds to the `/WEB-INF/psml` folder of your Web app.

### Parameters

This generator requires a `path` parameter. The path parameter **must** be a relative path from within the PSML content folder to a PSML file without the extension.

> **Note:** If the path resolves to a location outside the PSML folder, this generator won’t load the content.

### Returned XML

The top level element is always the requested folder. Its child elements are either sub folders or files within that folder.

```xml

<file name="[folder name]" path="[folder path]" type="folder">
  <!-- for each sub folder ... -->
  <file name="[file name]" path="[file path]" type="folder">
    <!-- more files and subfolders  -->
  </file>
  <!-- for each file ... -->
  <file name="[file name]"
        path="[file path]"
        type="file"
  media-type="application/vnd.pageseeder.psml+xml"
     length="[file size in bytes]"
   modified="[last modified date]"/>
</file>
```

### Error handling

#### Folder does not exist

If the folder cannot be found, this generator returns the following:

```xml

<file name="[file name]" path="[base path]" status="not-found"/>
```

#### Missing path parameter

If the path parameter is not specified, this generator sets the status to `BAD_REQUEST` and returns the following:

```xml

<error type="client" message="The parameter 'path' was not specified"/>
```

### Usage

```xml

<generator class="com.weborganic.bastille.psml.GetFolderInfo" ... >
  <parameter name="path" value="[path]"/>
</generator>
```

