> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Java: FileProvisioner

> CDKTN Core API Reference for FileProvisioner in Java.

The file provisioner copies files or directories from the machine running Terraform to the newly created resource.

The file provisioner supports both ssh and winrm type connections.

See [file](https://developer.hashicorp.com/terraform/language/resources/provisioners/file)

## Initializer <a name="Initializer" id="cdktn.FileProvisioner.Initializer" />

```java theme={null}
import io.cdktn.cdktn.FileProvisioner;

FileProvisioner.builder()
    .destination(java.lang.String)
    .type(java.lang.String)
//  .connection(SSHProvisionerConnection|WinrmProvisionerConnection)
//  .content(java.lang.String)
//  .source(java.lang.String)
    .build();
```

## Properties <a name="Properties" id="Properties" />

| **Name**                                                                           | **Type**                                                                                                                                                        | **Description**                                                                                                                                  |
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| <code><a href="#cdktn.FileProvisioner.property.destination">destination</a></code> | <code>java.lang.String</code>                                                                                                                                   | The source file or directory.                                                                                                                    |
| <code><a href="#cdktn.FileProvisioner.property.type">type</a></code>               | <code>java.lang.String</code>                                                                                                                                   | *No description.*                                                                                                                                |
| <code><a href="#cdktn.FileProvisioner.property.connection">connection</a></code>   | <code><a href="#cdktn.SSHProvisionerConnection">SSHProvisionerConnection</a>\|<a href="#cdktn.WinrmProvisionerConnection">WinrmProvisionerConnection</a></code> | Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect. |
| <code><a href="#cdktn.FileProvisioner.property.content">content</a></code>         | <code>java.lang.String</code>                                                                                                                                   | The destination path to write to on the remote system.                                                                                           |
| <code><a href="#cdktn.FileProvisioner.property.source">source</a></code>           | <code>java.lang.String</code>                                                                                                                                   | The direct content to copy on the destination.                                                                                                   |

***

### `destination`<sup>Required</sup> <a name="destination" id="cdktn.FileProvisioner.property.destination" />

```java theme={null}
public java.lang.String getDestination();
```

* *Type:* java.lang.String

The source file or directory.

Specify it either relative to the current working directory or as an absolute path.
This argument cannot be combined with content.

***

### `type`<sup>Required</sup> <a name="type" id="cdktn.FileProvisioner.property.type" />

```java theme={null}
public java.lang.String getType();
```

* *Type:* java.lang.String

***

### `connection`<sup>Optional</sup> <a name="connection" id="cdktn.FileProvisioner.property.connection" />

```java theme={null}
public SSHProvisionerConnection|WinrmProvisionerConnection getConnection();
```

* *Type:* <a href="#cdktn.SSHProvisionerConnection">SSHProvisionerConnection</a>|<a href="#cdktn.WinrmProvisionerConnection">WinrmProvisionerConnection</a>

Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect.

***

### `content`<sup>Optional</sup> <a name="content" id="cdktn.FileProvisioner.property.content" />

```java theme={null}
public java.lang.String getContent();
```

* *Type:* java.lang.String

The destination path to write to on the remote system.

See Destination Paths below for more information.

***

### `source`<sup>Optional</sup> <a name="source" id="cdktn.FileProvisioner.property.source" />

```java theme={null}
public java.lang.String getSource();
```

* *Type:* java.lang.String

The direct content to copy on the destination.

If destination is a file, the content will be written on that file.
In case of a directory, a file named tf-file-content is created inside that directory.
We recommend using a file as the destination when using content.
This argument cannot be combined with source.

***
