# Class: oFolder

## $. oFolder

$.oFolder Base Class

#### new $.oFolder(path)

openHarmony/openHarmony_file.js, line 60
  The $.oFolder helper class -- providing utilities for folder manipulation and access.

  Name | Type | Description
  --- | --- | ---
  `path` | string | The path to the folder.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `path` | string | The path to the folder.

### Members

#### contentArray.<$.oFile/$.oFolder>

  The content within the folder -- both folders and files.

#### existsstring

  The parent folder.

#### filesArray.<$.oFile>

  The files in the folder.
  Deprecated
    - use oFolder.getFiles() instead to specify filter

#### folder$.oFolder

  The parent folder.

#### foldersArray.<$.oFile>

  The folders within this folder.
  Deprecated
    - oFolder.folder is the containing parent folder, it can't also mean the children folders

#### namestring

  The name of the folder.

#### pathstring

  The path of the folder. Setting a path doesn't move the file, only changes where the file object is pointing.

### Methods

#### copy(folderPath, copyName, overwrite)

openHarmony/openHarmony_file.js, line 325
  WIP Copy the folder and its contents to another path. WIP

  Name | Type | Description
  --- | --- | ---
  `folderPath` | string | optional The path to the folder location to copy to (CFNote: Should this not be a $.oFolder?)
  `copyName` | string | optional The name of the folder to copy (CFNote: Should this be avoided and the folderPath be the full path?)
  `overwrite` | bool | optional Whether to overwrite the target.

#### create()

openHarmony/openHarmony_file.js, line 301
  Creates the folder, if it doesn't already exist.

#### get(name)

openHarmony/openHarmony_file.js, line 418
  Get the sub folder or file by name.

  Name | Type | Description
  --- | --- | ---
  `name` | string | The sub name of a folder or file within a directory.

#### getFiles(filter)

openHarmony/openHarmony_file.js, line 230
  get the files from the folder

  Name | Type | Description
  --- | --- | ---
  `filter` | string | optional Filter wildcards for the content of the folder.

#### getFolders(filter)

openHarmony/openHarmony_file.js, line 280
  gets the folders inside the oFolder

  Name | Type | Description
  --- | --- | ---
  `filter` | string | optional Filter wildcards for the content of the folder.

#### listFiles(filter)

openHarmony/openHarmony_file.js, line 210
  Lists the file names contained inside the folder.

  Name | Type | Description
  --- | --- | ---
  `filter` | string | optional Filter wildcards for the content of the folder.

#### listFolders(filter)

openHarmony/openHarmony_file.js, line 252
  lists the folder names contained inside the folder.

  Name | Type | Description
  --- | --- | ---
  `filter` | string | optional Filter wildcards for the content of the folder.

#### move(destFolderPath, overwrite){bool}

openHarmony/openHarmony_file.js, line 347
  Move this folder to the specified path.

  Name | Type | Default | Description
  --- | --- | --- | ---
  `destFolderPath` | string |  | The new complete path of the folder after the move
  `overwrite` | bool | false | optional Whether to overwrite the target.

  TODO
    - implement with Robocopy

  ##### Returns:

  Type | Description
  --- | ---
  bool | The result of the move.

#### moveToFolder(destFolderPath, overwrite)

openHarmony/openHarmony_file.js, line 380
  Move this folder to a different parent folder, while retaining its content and base name.

  Name | Type | Default | Description
  --- | --- | --- | ---
  `destFolderPath` | string |  | The path of the destination to copy the folder into.
  `overwrite` | bool | false | optional Whether to overwrite the target. Default is false.

#### remove(removeContents)

openHarmony/openHarmony_file.js, line 404
  Deletes the folder.

  Name | Type | Description
  --- | --- | ---
  `removeContents` | bool | Whether to check if the folder contains files before deleting.

#### rename(newName)

openHarmony/openHarmony_file.js, line 394
  Renames the folder

  Name | Type | Description
  --- | --- | ---
  `newName` | string |

#### toString(){string}

openHarmony/openHarmony_file.js, line 438
  Used in converting the folder to a string value, provides the string-path.

  ##### Returns:

  Type | Description
  --- | ---
  string | The folder path's as a string.