Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FileService

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

Hierarchy

  • FileService

Index

Constructors

constructor

Properties

Private fileService

fileService: FileService

Private httpClient

httpClient: HttpClient

Private loggerService

loggerService: LoggerService

Private notificationService

notificationService: NotificationService

Private siteBrowserState

siteBrowserState: SiteBrowserState

Methods

Private handleError

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

saveFiles

  • saveFiles(fileList: File[]): void
  • 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
  • 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
  • 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