Can be used for CRUD operations on dotCMS FileAssets. Not all CRUD operations are currently implemented

### Hierarchy

- FileService

## Index

### Constructors

- constructor

### Properties

- fileService
- httpClient
- loggerService
- notificationService
- siteBrowserState

### Methods

- handleError
- saveFiles
- uploadDirectories
- uploadFile

## Constructors

### constructor

- new FileService(httpClient: HttpClient, siteBrowserState: SiteBrowserState, fileService: FileService, loggerService: LoggerService, notificationService: NotificationService): FileService

- - Defined in core/util/file.services.ts:12

  #### Parameters

  - ##### httpClient: HttpClient

  - ##### siteBrowserState: SiteBrowserState

  - ##### fileService: FileService

  - ##### loggerService: LoggerService

  - ##### notificationService: NotificationService

  #### Returns FileService

## Properties

### Private fileService

fileService: FileService

- Defined in core/util/file.services.ts:17

### Private httpClient

httpClient: HttpClient

- Defined in core/util/file.services.ts:15

### Private loggerService

loggerService: LoggerService

- Defined in core/util/file.services.ts:18

### Private notificationService

notificationService: NotificationService

- Defined in core/util/file.services.ts:19

### Private siteBrowserState

siteBrowserState: SiteBrowserState

- Defined in core/util/file.services.ts:16

## Methods

### Private handleError

- handleError(error: any): Observable<string>

- - Defined in core/util/file.services.ts:66

  #### Parameters

  - ##### error: any

  #### Returns Observable<string>

### saveFiles

- saveFiles(fileList: File[]): void

- - Defined in core/util/file.services.ts:29

  Will save an array of local files and upload them to dotCMS. The dotCMS File Object will be built by the upload method which means it will not set a Structure/Content Type and will not set the Identifier if the file already exists in dotCMS. dotCMS will create a new version if the file already exists on the uploaded path or create a new one. The Structure/Content Type is set accordig to the default type on the uploaded dotCMS Folder

  #### Parameters

  - ##### fileList: File[]

    array of File objects to be POSTED to dotCMS

  #### Returns void

### uploadDirectories

- uploadDirectories(directories: File[]): void

- - Defined in core/util/file.services.ts:62

  Will post to dotCMS an array of the FolderNames to create. If the folder already exists nothing will happen. Even if there are failure it will create the Folders it is able to and log any error on folders it could not create

  #### Parameters

  - ##### directories: File[]

    list of local File System directories to create on dotCMS

  #### Returns void

### uploadFile

- uploadFile(file: File, path: string): void

- - Defined in core/util/file.services.ts:38

  Will upload a local file to dotCMS

  #### Parameters

  - ##### file: File

    File from teh File System to upload

  - ##### path: string

    dotCMS Path to upload file to

  #### Returns void

Generated using TypeDoc